Skip to content

Change license and add soundness checks #9

Change license and add soundness checks

Change license and add soundness checks #9

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: swift:5.10-jammy
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: Setup swift-format
run: |
cd ..
VERSION=510.1.0
git clone https://github.com/apple/swift-format.git
cd swift-format
git checkout "tags/$VERSION"
swift build -c release
cd "${GITHUB_WORKSPACE}"
- name: Run soundness
env:
SWIFTFORMAT_BIN: ${GITHUB_WORKSPACE}/../swift-format/.build/release/swift-format
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