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: smoke: runs-on: macos-latest steps: - uses: actions/checkout@v2 - run: swift test --generate-linuxmain - run: git diff --exit-code apple: runs-on: macos-latest strategy: matrix: 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-swift-4: name: linux (${{ matrix.swift }}) runs-on: ubuntu-latest strategy: matrix: swift: ['4.2', '5.0'] container: image: swift:${{ matrix.swift }} steps: - uses: actions/checkout@v2 - run: useradd -ms /bin/bash mxcl - run: chown -R mxcl . - run: su mxcl -c 'swift test --parallel' linux: runs-on: ubuntu-latest strategy: matrix: swift: - '5.1' - '5.2' - '5.3' - '5.4' container: image: swift:${{ matrix.swift }} steps: - uses: actions/checkout@v2 - run: useradd -ms /bin/bash mxcl # ^^ we need to be a normal user and not root for the tests to be valid - run: chown -R mxcl . - run: su mxcl -c 'swift test --parallel --enable-code-coverage' - name: Generate `.lcov` 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 with: file: ./info.lcov