Files
swiftpm-pathkit/.github/workflows/ci.yml
2021-05-28 16:01:57 -04:00

84 lines
2.3 KiB
YAML

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
apple:
runs-on: macos-latest
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 (4.2)
runs-on: ubuntu-18.04
steps:
- uses: fwal/setup-swift@v1
with:
swift-version: 4.2
- uses: actions/checkout@v2
- run: swift test --parallel
linux:
runs-on: ubuntu-18.04
strategy:
matrix:
swift:
- '5.0'
- '5.1'
- '5.2'
- '5.3'
steps:
- uses: fwal/setup-swift@v1
with:
swift-version: ${{ matrix.swift }}
- uses: actions/checkout@v2
- 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
# code coverage fails with 5.4 for some reason
linux-swift-5-4:
name: linux (5.4)
runs-on: ubuntu-18.04
steps:
- uses: fwal/setup-swift@v1
with:
swift-version: 5.4
- uses: actions/checkout@v2
- run: swift test --parallel