From 1859777332e758d858c1bce5936fb3d687a24ea4 Mon Sep 17 00:00:00 2001 From: rob thijssen Date: Sun, 31 May 2026 09:49:51 +0300 Subject: [PATCH] ci: add cuda type-check job so CUDA-only borrowck errors fail fast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run 244 caught a use-of-moved-value in a `#[cfg(feature = "cuda")]` block that the default-feature workspace clippy/test gate had no chance of seeing. The error appeared only when the RPM build workflow compiled with `--features cuda` — 30+ minutes after push. Add a `cuda-check` job to ci.yml that runs `cargo check -p neuron --features cuda --all-targets` on the rpm runner (where nvcc / cudarc build deps live; the generic `rust` runner doesn't have them). Borrow-check only — we never run tests here, the runner has no GPU. Same retry pattern as clippy/test. Both SRPM jobs (`srpm-cortex`, `srpm-neuron`) now gate on `cuda-check` so a CUDA build break can't reach the release pipeline. Co-Authored-By: Claude Opus 4.7 --- .gitea/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 26dcfc3..7487a9c 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -92,10 +92,40 @@ jobs: exit 1 - run: sccache --show-stats + # Type-check the CUDA-only code path. Borrow-check-only — we + # never run the tests here (the runner has no GPU). This catches + # the category of bug where a refactor compiles fine under the + # default feature set (which is what the `clippy` and `test` jobs + # exercise) but fails inside a `#[cfg(feature = "cuda")]` block. + # Lives on `runs-on: rpm` because that's where nvcc / cudarc's + # build prerequisites are installed; the generic `rust` runner + # doesn't have them. + cuda-check: + name: CUDA type-check + runs-on: rpm + steps: + - uses: actions/checkout@v4 + - name: cargo check --features cuda (with retry) + run: | + for attempt in 1 2 3; do + echo "::group::cuda-check attempt ${attempt}" + if cargo check -p neuron --features cuda --all-targets; then + echo "::endgroup::" + exit 0 + fi + echo "::endgroup::" + echo "cuda-check failed on attempt ${attempt}" + if [ "${attempt}" -lt 3 ]; then + sleep 5 + fi + done + echo "cuda-check failed after 3 attempts" + exit 1 + srpm-cortex: name: Build cortex SRPM runs-on: rpm - needs: [fmt, clippy, test] + needs: [fmt, clippy, test, cuda-check] if: startsWith(github.ref, 'refs/tags/v') steps: - uses: actions/checkout@v4 @@ -155,7 +185,7 @@ jobs: srpm-neuron: name: Build neuron SRPM runs-on: rpm - needs: [fmt, clippy, test] + needs: [fmt, clippy, test, cuda-check] if: startsWith(github.ref, 'refs/tags/v') steps: - uses: actions/checkout@v4