Skip to content

Change license and add soundness checks (#13) #22

Change license and add soundness checks (#13)

Change license and add soundness checks (#13) #22

Workflow file for this run

name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
soundness:
container:
image: ghcr.io/lovetodream/swift-format-ci:v5.10.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Mark repo safe in non-fake global config
run: git config --global --add safe.directory "${GITHUB_WORKSPACE}"
- name: Run soundness
run: |
scripts/soundness.sh
exit $(git status --porcelain | wc -l)
api-breakage:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
container: swift:jammy
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# https://github.com/actions/checkout/issues/766
- name: API breaking changes
run: |
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
swift package diagnose-api-breaking-changes origin/main
tests:
container:
image: swift:5.10-jammy
runs-on: ubuntu-latest
services:
loki:
image: grafana/loki:3.0.0
steps:
- uses: actions/checkout@v4
- name: Cache Swift PM
uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-ci-spm-${{ hashFiles('Package.swift') }}
restore-keys: ${{ runner.os }}-ci-spm-
- name: Resolve Swift dependencies
run: swift package resolve
- name: Build
run: swift build
- name: Run tests
run: swift test --enable-code-coverage
env:
XCT_LOKI_URL: http://loki:3100
- name: Prepare Code Coverage
run: |
llvm-cov export -format "lcov" \
.build/debug/swift-log-lokiPackageTests.xctest \
-ignore-filename-regex="\.pb\.swift" \
-ignore-filename-regex="\/Tests\/" \
-instr-profile .build/debug/codecov/default.profdata \
> info.lcov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: info.lcov