Skip to content

Commit

Permalink
wip: Split macOS and Linux GHA into separate jobs
Browse files Browse the repository at this point in the history
Add concurrency  setting to GHS so only one will run at a time
  • Loading branch information
cybersonik committed Aug 30, 2024
1 parent c10be2e commit f802fa8
Showing 1 changed file with 44 additions and 5 deletions.
49 changes: 44 additions & 5 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ on:
pull_request:
branches: [ "main" ]

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build and test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
macos:
strategy:
matrix:
os: [macos-14, ubuntu-latest]
os: [macos-14]

name: Build and test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: swift-actions/setup-swift@v2
with:
Expand Down Expand Up @@ -48,4 +52,39 @@ jobs:
with:
name: Swift tests on ${{ matrix.os }}
path: results.xml
reporter: java-junit
reporter: java-junit

ubuntu:
strategy:
matrix:
os: [ubuntu-latest]

name: Build and test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
container: swiftlang/swift:nightly-6.0-jammy
steps:
- uses: actions/checkout@v3
- name: Get swift version
run: swift --version
- name: Get macOS version
run: sw_vers
if: startsWith( matrix.os, 'macos' )
- name: Set TEST_GITHUB_TOKEN env variable
shell: bash
env:
TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }}
run: |
echo "$TEST_GITHUB_TOKEN" > $HOME/.env
- name: Build
run: swift build --build-tests
- name: Run tests
run: swift test --parallel --xunit-output=results.xml
- name: Report test results
uses: phoenix-actions/test-reporting@v8
id: test-report
if: success() || failure() # run this step even if previous step failed
with:
name: Swift tests on ${{ matrix.os }}
path: results.xml
reporter: java-junit

0 comments on commit f802fa8

Please sign in to comment.