test: Migrate to Swift Testing #109
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
# This workflow will build a Swift project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift | |
name: Swift | |
permissions: | |
id-token: write | |
contents: read | |
checks: write | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
concurrency: | |
group: ci-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
macos: | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [macos-15] | |
name: Build and test on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Xcode Select Version | |
uses: mobiledevops/xcode-select-version-action@v1 | |
with: | |
xcode-select-version: 16 | |
- name: Get macOS version | |
run: sw_vers | |
- name: Get xcodebuild version | |
run: xcodebuild -version | |
- name: Get swift version | |
run: swift --version | |
- name: Build | |
run: swift build --build-tests | |
- name: Run tests | |
run: swift test --skip testGetPullRequestsPerformance --parallel --xunit-output=results.xml | |
env: | |
TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }} | |
- name: Report test results | |
uses: phoenix-actions/test-reporting@v15 | |
id: test-report | |
if: success() || failure() # run this step even if previous step failed | |
with: | |
name: Swift tests on ${{ matrix.os }} | |
path: results-swift-testing.xml | |
reporter: java-junit | |
ubuntu: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
name: Build and test on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
container: | |
image: swift:latest | |
env: | |
TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get Linux version | |
run: uname -a | |
- name: Get swift version | |
run: swift --version | |
- name: Build | |
run: swift build --build-tests | |
- name: Run tests | |
run: swift test --skip testGetPullRequestsPerformance --parallel --xunit-output=results.xml | |
- name: Workaround for test-reporting issue 1169 | |
run: git config --system --add safe.directory /__w/github-stats/github-stats | |
if: success() || failure() # run this step even if previous step failed | |
- name: Report test results | |
uses: phoenix-actions/test-reporting@v15 | |
id: test-report | |
if: success() || failure() # run this step even if previous step failed | |
with: | |
name: Swift tests on ${{ matrix.os }} | |
path: results-swift-testing.xml | |
reporter: java-junit | |