name: CI on: pull_request: paths: - '**/*.swift' - .github/workflows/ci.yml schedule: - cron: '3 3 * * 5' # 3:03 AM, every Friday jobs: smoke: runs-on: macos-latest steps: - uses: technote-space/auto-cancel-redundant-job@v1 - uses: actions/checkout@v2 - run: swift test --generate-linuxmain - run: git diff --exit-code apple: runs-on: macos-10.15 strategy: matrix: destination: - platform=iOS Simulator,OS=latest,name=iPhone 12 - platform=tvOS Simulator,OS=latest,name=Apple TV # - platform=watchOS Simulator,OS=latest,name=Apple Watch Series 5 - 40mm # ^^ coming with Xcode 12.5 which is not yet available on GHA - platform=macOS steps: - uses: actions/checkout@v2 - uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: 12.4 - run: swift package generate-xcodeproj --enable-code-coverage - uses: sersoft-gmbh/xcodebuild-action@v1 with: project: Path.swift.xcodeproj scheme: Path.swift-Package destination: ${{ matrix.destination }} action: test - 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