48 lines
1.5 KiB
YAML
48 lines
1.5 KiB
YAML
name: macOS
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
macos-test-build-release-xcode:
|
|
runs-on: macOS-latest
|
|
strategy:
|
|
matrix:
|
|
xcode: ["14.3.1", "15.4", "16.0"]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Select Xcode ${{ matrix.xcode }}
|
|
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
|
|
- name: Test
|
|
run: swift test -c release --parallel --xunit-output .build/xUnit-output.xml --enable-code-coverage
|
|
env:
|
|
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
|
|
- name: Upload test artifacts
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4.4.2
|
|
with:
|
|
name: test-artifacts-${{ matrix.xcode }}-${{ github.run_id }}
|
|
path: |
|
|
.build/*.yaml
|
|
.build/*.xml
|
|
.build/*.json
|
|
.build/*.txt
|
|
.build/**/*.xctest
|
|
.build/**/*.json
|
|
.build/**/*.txt
|
|
if-no-files-found: warn
|
|
include-hidden-files: true
|
|
|
|
- name: Generate coverage report
|
|
run: xcrun llvm-cov export -format="lcov" .build/**/*PackageTests.xctest/Contents/MacOS/*PackageTests -instr-profile .build/**/codecov/default.profdata > coverage.lcov
|
|
- name: Upload code coverage report
|
|
uses: codecov/codecov-action@v4.6.0
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
file: coverage.lcov
|
|
fail_ci_if_error: true
|