Update Xcode Versions #364
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: | |
swiftpm_tests: | |
name: SwiftPM on Xcode ${{ matrix.xcode }} | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
xcode: | |
- "14.2" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Select Xcode ${{ matrix.xcode }} | |
run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app | |
- name: SwiftPM tests | |
run: swift test --enable-code-coverage | |
- name: Convert coverage for Codecov | |
id: convert-coverage | |
uses: sersoft-gmbh/swift-coverage-action@v3.0.0 | |
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 | |
xcode_tests: | |
name: ${{ matrix.platform }} on Xcode ${{ matrix.xcode }} | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
xcode: | |
- "14.2" | |
platform: ["iOS", "tvOS", "macOS"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Select Xcode ${{ matrix.xcode }} | |
run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app | |
- name: Install Mint | |
run: brew install mint | |
- name: Cache Mint | |
uses: actions/cache@v3 | |
with: | |
path: ~/.mint | |
key: ${{ runner.os }}-mint-xcode_${{ matrix.xcode }}-${{ hashFiles('**/Mintfile') }} | |
restore-keys: | | |
${{ runner.os }}-mint-xcode_${{ matrix.xcode }} | |
- run: mint bootstrap | |
- name: Cache Carthage | |
uses: actions/cache@v3 | |
with: | |
path: Carthage | |
key: ${{ runner.os }}-carthage-xcode_${{ matrix.xcode }}-${{ matrix.platform }}-${{ hashFiles('**/Cartfile.resolved') }} | |
restore-keys: | | |
${{ runner.os }}-carthage-xcode_${{ matrix.xcode }}-${{ matrix.platform }}- | |
${{ runner.os }}-carthage-xcode_${{ matrix.xcode }}- | |
- name: carthage bootstrap | |
run: carthage bootstrap --use-xcframeworks --cache-builds --platform ${{ matrix.platform }} --configuration Debug | |
env: | |
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Test ${{ matrix.platform }} | |
run: | | |
set -e -o pipefail | |
mint run xcutils test ${{ matrix.platform }} --scheme "Partial-${{ matrix.platform }}" --enable-code-coverage | $(mint which xcbeautify) | |
- name: Convert coverage for Codecov | |
id: convert-coverage | |
uses: sersoft-gmbh/swift-coverage-action@v3.0.0 | |
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 | |
carthage_build: | |
name: Carthage Build on Xcode ${{ matrix.xcode }} | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
xcode: | |
- "13.2" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Select Xcode ${{ matrix.xcode }} | |
run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app | |
- name: carthage build | |
run: carthage build --no-skip-current --use-xcframeworks --platform iOS,macOS,tvOS,watchOS | |
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.2", "5.3", "5.4", "5.5"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: swift test | |
run: swift test | |
tests_pass: | |
name: Tests pass | |
runs-on: ubuntu-latest | |
needs: [swiftpm_tests, xcode_tests, carthage_build, linux_tests] | |
steps: | |
- run: echo "Tests have passed" |