diff --git a/.forgejo/workflows/build-grid-rs.yaml b/.forgejo/workflows/build-grid-rs.yaml index 95edb2b3..addfa2c5 100644 --- a/.forgejo/workflows/build-grid-rs.yaml +++ b/.forgejo/workflows/build-grid-rs.yaml @@ -59,22 +59,6 @@ jobs: echo "Docker daemon never became reachable" >&2 exit 1 - # Gate the image build on a clean test run so a push that regresses - # the scorer or breaks clippy never produces an image. The stock - # `rust:1.94-trixie` image doesn't ship clippy, so add it before - # running. - - name: cargo clippy + test - run: | - docker run --rm \ - -v "$(pwd)/rust/prop_grid_rs":/src \ - -w /src \ - rust:1.94-trixie \ - sh -euc ' - rustup component add clippy - cargo clippy --all-targets -- -D warnings - cargo test - ' - - name: Generate image tag id: tag run: | diff --git a/rust/prop_grid_rs/Dockerfile b/rust/prop_grid_rs/Dockerfile index df091d3e..16fe8947 100644 --- a/rust/prop_grid_rs/Dockerfile +++ b/rust/prop_grid_rs/Dockerfile @@ -16,7 +16,14 @@ RUN mkdir -p src src/bin \ && rm -rf src COPY src ./src -RUN cargo build --release --bin worker +COPY tests ./tests + +# Lint + test gate the image build — a regressed scorer or a clippy +# warning never produces a pushable image. +RUN rustup component add clippy \ + && cargo clippy --all-targets -- -D warnings \ + && cargo test --release \ + && cargo build --release --bin worker # Runtime image: slim debian plus wgrib2. libexpat/libjasper pulled in # transitively by wgrib2 for PNG/JPEG2000 GRIB2 decompression.