name: CI on: [pull_request] 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 macOS: needs: smoke runs-on: macos-latest strategy: matrix: xcode: # - 10.3 # Swift 5.0 (doesn’t work on GHA macOS image :-/) - 11.3 # Swift 5.1 - ^11.4 # Swift 5.2 steps: - uses: actions/checkout@v2 - name: setup-xcode uses: maxim-lobanov/setup-xcode@1.0 with: xcode-version: ${{ matrix.xcode }} - run: swift --version - run: swift test --parallel otherOS: needs: smoke runs-on: macos-latest strategy: matrix: destination: - platform=iOS Simulator,OS=latest,name=iPhone 11 - platform=tvOS Simulator,OS=latest,name=Apple TV - platform=macOS steps: - uses: actions/checkout@v2 - uses: maxim-lobanov/setup-xcode@1.0 with: xcode-version: 12 # Swift 5.3 - run: swift --version - 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 watchOS: needs: smoke runs-on: macos-latest steps: - uses: actions/checkout@v2 - run: swift package generate-xcodeproj - uses: sersoft-gmbh/xcodebuild-action@v1 with: project: Path.swift.xcodeproj scheme: Path.swift-Package destination: platform=watchOS Simulator,OS=latest,name=Apple Watch Series 5 - 40mm action: build linux-4-2: needs: smoke runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: fwal/setup-swift@v1 with: swift-version: 4.2 - run: swift test --parallel # doesn’t support code coverage linux: needs: smoke runs-on: ubuntu-latest strategy: matrix: swift: - 5.0.3 - 5.1 - 5.2 # - 5.3 not yet available sigh steps: - uses: actions/checkout@v2 - uses: fwal/setup-swift@v1 with: swift-version: ${{ matrix.swift }} - run: swift test --parallel --enable-code-coverage - name: Generate Coverage Report run: | sudo apt-get -qq update && sudo apt-get -qq install llvm-10 export b=$(swift build --show-bin-path) && llvm-cov-10 \ export -format lcov \ -instr-profile=$b/codecov/default.profdata \ --ignore-filename-regex='\.build/' \ $b/Path.swiftPackageTests.xctest \ > info.lcov - uses: codecov/codecov-action@v1 with: file: ./info.lcov