CI: a pull request fast lane; the heavy checks run on main (#2278)
Pull requests now run the repository checks, Clippy, the affected crates' tests in 2 shards, and the doc tests. Windows, the reference tests and the robustness goldens run on pushes to main and in the nightly, where a break is fixed forward. This is the split Bevy, Zed and Ruff use, and it cuts each pull request's CI to about a third. Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
8c503ad1be
commit
2f31138f9d
1 file changed
+7
-12
@@ -162,6 +162,9 @@ jobs:
|
|||||||
if [ "$EVENT_NAME" = pull_request ] && [ "$full" != true ]; then
|
if [ "$EVENT_NAME" = pull_request ] && [ "$full" != true ]; then
|
||||||
case " $packages " in *" solidcraft-cli "*) ;; *) oracle=false ;; esac
|
case " $packages " in *" solidcraft-cli "*) ;; *) oracle=false ;; esac
|
||||||
fi
|
fi
|
||||||
|
# The pull request fast lane: Windows and the reference tests run on main (and the nightly),
|
||||||
|
# not on every pull request push; a break there is fixed forward on main.
|
||||||
|
if [ "$EVENT_NAME" = pull_request ]; then windows=false; oracle=false; fi
|
||||||
{
|
{
|
||||||
echo "native=$native"
|
echo "native=$native"
|
||||||
echo "kernel=$kernel"
|
echo "kernel=$kernel"
|
||||||
@@ -288,7 +291,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
shard: [1, 2, 3, 4]
|
# Pull requests test their affected crates in 2 shards; main and the nightly use 4.
|
||||||
|
shard: ${{ fromJSON(github.event_name == 'pull_request' && '[1, 2]' || '[1, 2, 3, 4]') }}
|
||||||
env:
|
env:
|
||||||
# Pictures (snapshots, screenshots, ui.render, the viewport's offscreen tests) are drawn on
|
# Pictures (snapshots, screenshots, ui.render, the viewport's offscreen tests) are drawn on
|
||||||
# the GPU. The runner has none: Mesa's lavapipe (software Vulkan) draws them, and a test that
|
# the GPU. The runner has none: Mesa's lavapipe (software Vulkan) draws them, and a test that
|
||||||
@@ -313,6 +317,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
EVENT_NAME: ${{ github.event_name }}
|
EVENT_NAME: ${{ github.event_name }}
|
||||||
SHARD: ${{ matrix.shard }}
|
SHARD: ${{ matrix.shard }}
|
||||||
|
SHARDS: ${{ github.event_name == 'pull_request' && 2 || 4 }}
|
||||||
run: |
|
run: |
|
||||||
# Pull requests skip the heavy tests (default-filter in .config/nextest.toml).
|
# Pull requests skip the heavy tests (default-filter in .config/nextest.toml).
|
||||||
all=()
|
all=()
|
||||||
@@ -324,17 +329,7 @@ jobs:
|
|||||||
# Extract into ./target: tests that run a built binary (env!("CARGO_BIN_EXE_*")) have
|
# Extract into ./target: tests that run a built binary (env!("CARGO_BIN_EXE_*")) have
|
||||||
# the build job's path, which is the same checkout path here.
|
# the build job's path, which is the same checkout path here.
|
||||||
cargo nextest run --archive-file tests.tar.zst --workspace-remap . --extract-to . --extract-overwrite \
|
cargo nextest run --archive-file tests.tar.zst --workspace-remap . --extract-to . --extract-overwrite \
|
||||||
--profile ci --partition "slice:$SHARD/4" --no-tests=pass "${all[@]}"
|
--profile ci --partition "slice:$SHARD/$SHARDS" --no-tests=pass "${all[@]}"
|
||||||
- name: Robustness goldens sample (pull requests that touch the kernel)
|
|
||||||
# Every 8th seed of tests/robustness/goldens.json (each seed is a test), a quarter per
|
|
||||||
# shard; pushes to main and the nightly run every seed in the step above.
|
|
||||||
if: github.event_name == 'pull_request' && needs.changes.outputs.kernel == 'true'
|
|
||||||
env:
|
|
||||||
SHARD: ${{ matrix.shard }}
|
|
||||||
run: |
|
|
||||||
cargo nextest run --archive-file tests.tar.zst --workspace-remap . --extract-to . --extract-overwrite \
|
|
||||||
--profile ci --ignore-default-filter --partition "slice:$SHARD/4" --no-tests=pass \
|
|
||||||
-E 'package(solidcraft-engine) & test(/^tests::robustness_goldens::seed_(00|08|16|24|32|40|48|56|64|72|80|88)$/)'
|
|
||||||
- name: Upload test timings
|
- name: Upload test timings
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||||
|
|||||||
Reference in new issue
Block a user