WIP: Terrible attempt at Sendable conformance #209
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: Tests | |
on: | |
push: | |
pull_request: | |
branches: | |
- "**:**" # PRs from forks have a prefix with `owner:` | |
jobs: | |
macos_tests: | |
name: macOS Tests (SwiftPM, Xcode ${{ matrix.xcode }}) | |
runs-on: "macos-12" | |
strategy: | |
fail-fast: false | |
matrix: | |
xcode: | |
- "13.2.1" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Select Xcode ${{ matrix.xcode }} | |
run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app | |
- name: Cache SwiftPM | |
uses: actions/cache@v3 | |
with: | |
path: .build | |
key: ${{ runner.os }}-xcode_${{ matrix.xcode }}-swiftpm-deps-${{ github.workspace }}-${{ hashFiles('Package.resolved') }} | |
restore-keys: | | |
${{ runner.os }}-xcode_${{ matrix.xcode }}-swiftpm-deps-${{ github.workspace }} | |
- name: SwiftPM tests | |
run: swift test --enable-code-coverage | |
- name: Convert coverage for Codecov | |
id: convert-coverage | |
uses: sersoft-gmbh/[email protected] | |
with: | |
ignore-conversion-failures: true | |
fail-on-empty-output: true | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ${{ join(fromJSON(steps.convert-coverage.outputs.files), ',') }} | |
fail_ci_if_error: true | |
ios_tvos_watchos_maccatalyst_tests: | |
name: ${{ matrix.os }} Tests (Xcode ${{ matrix.xcode }}) | |
runs-on: "macos-12" | |
strategy: | |
fail-fast: false | |
matrix: | |
xcode: | |
- "13.2.1" | |
os: | |
- "iOS" | |
- "tvOS" | |
- "watchOS" | |
- "macCatalyst" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Select Xcode ${{ matrix.xcode }} | |
run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app | |
- name: Cache SwiftPM | |
uses: actions/cache@v3 | |
with: | |
path: CIDependencies/.build | |
key: ${{ runner.os }}-xcode_${{ matrix.xcode }}-swiftpm-ci-deps-${{ github.workspace }}-${{ hashFiles('CIDependencies/Package.resolved') }} | |
restore-keys: | | |
${{ runner.os }}-xcode_${{ matrix.xcode }}-swiftpm-ci-deps-${{ github.workspace }} | |
- name: Run Tests | |
if: matrix.os != 'watchOS' || matrix.xcode != '11.7' | |
run: swift run --configuration release --skip-update --package-path ./CIDependencies/ xcutils test ${{ matrix.os }} --scheme Persist --enable-code-coverage | |
- name: Convert coverage for Codecov | |
id: convert-coverage | |
if: (matrix.os != 'watchOS' || matrix.xcode != '11.7') && matrix.os != 'macCatalyst' | |
uses: sersoft-gmbh/[email protected] | |
with: | |
ignore-conversion-failures: true | |
fail-on-empty-output: true | |
- name: Upload coverage to Codecov | |
if: (matrix.os != 'watchOS' || matrix.xcode != '11.7') && matrix.os != 'macCatalyst' | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ${{ join(fromJSON(steps.convert-coverage.outputs.files), ',') }} | |
fail_ci_if_error: true | |
- name: Build for watchOS | |
if: matrix.os == 'watchOS' && matrix.xcode == '11.7' | |
run: swift run --configuration release --skip-update --package-path ./CIDependencies/ xcutils build watchOS --scheme Persist | |
linux_tests: | |
name: Swift ${{ matrix.swift }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
container: | |
image: swift:${{ matrix.swift }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
swift: ["5.5", "5.6", "5.7"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: swift test | |
run: swift test --enable-test-discovery |