SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
CI: Windows jobs only when what they test changes; only main saves caches (#1840)
Irakli Kourtisdaf1dc420178
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 232c761b4f..8615b5c233 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -6,7 +6,10 @@# vendor/, tests/, scripts/ or any file no package owns select the whole workspace, as do# pushes to main, the nightly run and Run workflow.# Tests are built once and run in 4 shards. A few heavy tests (see .config/nextest.toml) are-# skipped on pull requests and run on pushes to main and nightly.+# skipped on pull requests and run on pushes to main and nightly. The Windows jobs (D3D12 shaders+# and app startup) run on pull requests only when what they test changes (the GPU crate, the app,+# the viewport's GPU glue, the graphics dependencies, their scripts or this file); main and+# nightly always run them. Only main saves the build caches; pull requests restore them.# Cross-compilation is opt-in through Run workflow; release builds remain in release.yml.name: CI@@ -57,6 +60,7 @@ jobs:outputs:native: ${{ steps.paths.outputs.native }}kernel: ${{ steps.paths.outputs.kernel }}+ windows: ${{ steps.paths.outputs.windows }}full: ${{ steps.paths.outputs.full }}packages: ${{ steps.paths.outputs.packages }}steps:@@ -72,15 +76,23 @@ jobs:run: |native=falsekernel=false+ windows=falsefull=truepackages=if [ "$EVENT_NAME" != pull_request ]; thennative=true+ windows=trueelse# Compare both old and new paths of renames; unknown paths run native checks.git diff --no-renames --name-only -z "$BASE_SHA...$HEAD_SHA" > "$RUNNER_TEMP/ci-paths"while IFS= read -r -d '' path; docase "$path" in crates/kernel/*|vendor/truck-*) kernel=true ;; esac+ # What the Windows D3D12 jobs exercise: the GPU crate and its shaders, the app and+ # its startup, the viewport's wgpu glue, the vendored egui-wgpu, their scripts.+ case "$path" in+ crates/gpu/*|apps/solidcraft/*|crates/ui-egui/src/gpu.rs|vendor/egui-wgpu/*) windows=true ;;+ tools/windows-*.ps1|.github/workflows/ci.yml|rust-toolchain*|.cargo/*) windows=true ;;+ esaccase "$path" in.github/workflows/ci.yml) native=true ;;*.rs|Cargo.toml|Cargo.lock|*/Cargo.toml|.cargo/*|rust-toolchain*) native=true ;;@@ -88,6 +100,12 @@ jobs:*) native=true ;;esacdone < "$RUNNER_TEMP/ci-paths"+ # A lockfile change that moves the graphics stack (wgpu, naga, egui, winit, windows).+ if [ "$windows" = false ] && grep -qxz 'Cargo.lock' "$RUNNER_TEMP/ci-paths" \+ && git diff "$BASE_SHA...$HEAD_SHA" -- Cargo.lock \+ | grep -Eq '^[ +-]name = "(wgpu[a-z_-]*|naga|egui[a-z_-]*|eframe|winit|windows[a-z_-]*|d3d12)"'; then+ windows=true+ fi# Pull requests build and test the touched packages and their dependents.python3 -I scripts/ci/affected.py --paths "$RUNNER_TEMP/ci-paths" > "$RUNNER_TEMP/ci-affected"cat "$RUNNER_TEMP/ci-affected"@@ -99,6 +117,7 @@ jobs:{echo "native=$native"echo "kernel=$kernel"+ echo "windows=$windows"echo "full=$full"echo "packages=$packages"} >> "$GITHUB_OUTPUT"@@ -115,6 +134,7 @@ jobs:- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2with:key: repo-checks+ save-if: ${{ github.ref == 'refs/heads/main' }}- name: Formatrun: cargo fmt --all -- --check- name: Asset attribution@@ -146,6 +166,7 @@ jobs:- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2with:key: native-clippy+ save-if: ${{ github.ref == 'refs/heads/main' }}- name: Clippyenv:FULL: ${{ needs.changes.outputs.full }}@@ -173,6 +194,7 @@ jobs:- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2with:key: native-tests+ save-if: ${{ github.ref == 'refs/heads/main' }}- name: Set up compiler cacheuses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11with:@@ -371,6 +393,7 @@ jobs:- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2with:key: doc-tests+ save-if: ${{ github.ref == 'refs/heads/main' }}- name: Set up compiler cacheuses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11with:@@ -395,6 +418,7 @@ jobs:- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2with:key: oracle+ save-if: ${{ github.ref == 'refs/heads/main' }}- name: Set up compiler cacheuses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11with:@@ -418,7 +442,7 @@ jobs:windows-fxc:name: Windows D3D12 FXC shadersneeds: changes- if: needs.changes.outputs.native == 'true'+ if: needs.changes.outputs.windows == 'true'runs-on: windows-latesttimeout-minutes: 45env:@@ -433,6 +457,7 @@ jobs:- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2with:key: windows-fxc+ save-if: ${{ github.ref == 'refs/heads/main' }}# One test at a time: WARP's shader JIT crashes now and then (a null read in# d3d10warp.dll's JIT optimizer, about 1 run in 60) when several devices compile compute# pipelines at once, which the parallel tests do. Minidumps showed it in WARP itself, not@@ -445,7 +470,7 @@ jobs:windows-startup:name: Windows app startupneeds: changes- if: needs.changes.outputs.native == 'true'+ if: needs.changes.outputs.windows == 'true'runs-on: windows-latesttimeout-minutes: 60steps:@@ -454,6 +479,7 @@ jobs:- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2with:key: windows-startup+ save-if: ${{ github.ref == 'refs/heads/main' }}- name: Backend order and probing on Windowsrun: cargo test -p solidcraft --profile ci --locked -- startup::tests native_crash::tests native_frame::tests- name: Build the app@@ -476,6 +502,7 @@ jobs:CHANGES: ${{ needs.changes.result }}CHECKS: ${{ needs.checks.result }}NATIVE: ${{ needs.changes.outputs.native }}+ WINDOWS: ${{ needs.changes.outputs.windows }}CLIPPY: ${{ needs.clippy.result }}BUILD: ${{ needs.build-tests.result }}TESTS: ${{ needs.tests.result }}@@ -492,6 +519,8 @@ jobs:test "$TESTS" = successtest "$DOCS" = successtest "$ORACLE" = success+ fi+ if [ "$WINDOWS" = true ]; thentest "$WINDOWS_FXC" = successtest "$WINDOWS_STARTUP" = successfi@@ -509,6 +538,7 @@ jobs:- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2with:key: wasm+ save-if: ${{ github.ref == 'refs/heads/main' }}- run: cargo xtask wasmriscv64-gates:@@ -530,6 +560,7 @@ jobs:- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2with:key: riscv64+ save-if: ${{ github.ref == 'refs/heads/main' }}- name: Install cross-compilation dependenciesrun: |# Ubuntu's regular archive serves amd64; RISC-V packages live in ports.