From 4347029f0f29eedf0d5f1dcbd1460225ca527828 Mon Sep 17 00:00:00 2001 From: Jay Herron Date: Sat, 30 Aug 2025 16:12:04 -0600 Subject: [PATCH] build: Improves CI This was mostly copied over from https://github.com/GraphQLSwift/ci --- .github/workflows/test.yml | 48 +++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 104f2a0..c8e5576 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,23 +1,43 @@ -name: test +name: Test + on: pull_request: push: { branches: [ main ] } +env: + PACKAGE_PATH: ${{ inputs.package_path != '' && format('--package-path={0}', inputs.package_path) || '' }} + jobs: - macos-test: + macos: + name: Test on macOS runs-on: macos-latest steps: - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest - - uses: actions/checkout@v4 - - name: Darwin build & test - run: swift test --enable-all-traits --skip IntegrationTests - linux-test: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + - uses: actions/checkout@v4 + - name: Build and test + run: | + swift test \ + --parallel \ + --enable-all-traits \ + --skip IntegrationTests + + linux: + name: Test on Linux - ${{ matrix.swift-image }} + strategy: + matrix: + swift-image: + - "swift:6.1-jammy" + - "swift:6.1-noble" runs-on: ubuntu-latest - container: - image: swift:latest + container: ${{ matrix.swift-image }} steps: - - uses: actions/checkout@v4 - - name: Linux build & test - run: swift test --traits ClientNIO,ServerVapor --skip IntegrationTests + - name: Checkout + uses: actions/checkout@v4 + - name: Test + run: | + swift test \ + --parallel \ + --traits ClientNIO,ServerVapor \ + --skip IntegrationTests