Skip to content

Commit

Permalink
Skip macOS in PR builds, include integration tests (#1044)
Browse files Browse the repository at this point in the history
This change updates the logic for the build matrix to skip macOS when
building for PRs and enables integration tests. This keeps the
contentions and slower macOS runners reserved for merge queue to main.

To make this work nicely with branch protection rules, a "Status Check"
task is introduced that depends on previous jobs, only executes on
failure of dependencies, and always fails. Branch protection treats this
job as required, and then PR build will require only those matrix
combinations enabled in that context while merge queues will require the
full matrix to run and pass.
  • Loading branch information
swernli authored Jan 19, 2024
1 parent ee50484 commit a8f45fe
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
is_pr:
- ${{ github.event_name == 'pull_request' }}
exclude:
- os: macos-latest
is_pr: true

runs-on: ${{matrix.os}}

Expand Down Expand Up @@ -105,11 +110,15 @@ jobs:

integration-tests:
name: Integration tests
if: ${{ ! github.event.pull_request }}
timeout-minutes: 15
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
is_pr:
- ${{ github.event_name == 'pull_request' }}
exclude:
- os: macos-latest
is_pr: true

runs-on: ${{matrix.os}}

Expand Down Expand Up @@ -193,3 +202,13 @@ jobs:
console.log("no change in memory usage detected by benchmark");
}
if: ${{ github.base_ref != null }}

status-check:
name: Status Check
needs: [format, clippy, web-check, build, integration-tests, runBenchmark]
runs-on: ubuntu-latest
if: failure()
steps:
- run: |
echo "::error Build failed"
exit 1

0 comments on commit a8f45fe

Please sign in to comment.