CI #220
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
paths: | |
- '**/*.swift' | |
- .github/workflows/ci.yml | |
schedule: | |
- cron: '3 3 * * 5' # 3:03 AM, every Friday | |
concurrency: | |
group: ${{ github.head_ref || 'push' }} | |
cancel-in-progress: true | |
jobs: | |
verify-linuxmain: | |
runs-on: macos-10.15 | |
steps: | |
- uses: actions/checkout@v2 | |
- run: swift test --generate-linuxmain | |
- run: git diff --exit-code | |
apple: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- macos-10.15 | |
- macos-11 | |
platform: | |
- iOS | |
- tvOS | |
- macOS | |
- watchOS | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: mxcl/xcodebuild@v1 | |
with: | |
platform: ${{ matrix.platform }} | |
code-coverage: true | |
warnings-as-errors: true | |
- uses: codecov/codecov-action@v1 | |
linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
swift: | |
- swift:4.2 | |
- swift:5.0 | |
- swift:5.1 | |
- swift:5.2 | |
- swift:5.3 | |
- swift:5.4 | |
- swiftlang/swift:nightly-5.5 | |
container: | |
image: ${{ matrix.swift }} | |
steps: | |
- uses: mxcl/get-swift-version@v1 | |
id: swift | |
- uses: actions/checkout@v2 | |
- run: useradd -ms /bin/bash mxcl | |
- run: chown -R mxcl . | |
# ^^ we need to be a normal user and not root for the tests to be valid | |
- run: echo ARGS=--enable-code-coverage >> $GITHUB_ENV | |
if: ${{ steps.swift.outputs.marketing-version > 5 }} | |
- run: su mxcl -c "swift test --parallel $ARGS" | |
- name: Generate `.lcov` | |
if: ${{ steps.swift.outputs.marketing-version > 5 }} | |
run: | | |
apt-get -qq update && apt-get -qq install curl | |
b=$(swift build --show-bin-path) | |
llvm-cov export \ | |
-format lcov \ | |
-instr-profile="$b"/codecov/default.profdata \ | |
--ignore-filename-regex='\.build|Tests' \ | |
"$b"/*.xctest \ | |
> info.lcov | |
- uses: codecov/codecov-action@v1 | |
if: ${{ steps.swift.outputs.marketing-version > 5 }} | |
with: | |
file: ./info.lcov |