diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 2d806cc..bc63309 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -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: @@ -48,4 +52,39 @@ jobs: with: name: Swift tests on ${{ matrix.os }} path: results.xml - reporter: java-junit \ No newline at end of file + 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 +