Add resource-bounded local verification lanes
Run pinned Rust and browser toolchains in fast and full container lanes with explicit CPU and memory limits.
This commit is contained in:
parent
9156b75c62
commit
ff379fb002
1 changed files with 114 additions and 1 deletions
41
Dockerfile.test
Normal file
41
Dockerfile.test
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# syntax=docker/dockerfile:1.7@sha256:a57df69d0ea827fb7266491f2813635de6f17269be881f696fbfdf2d83dda33e
|
||||
|
||||
ARG RUST_IMAGE=docker.io/library/rust:1.97.0-bookworm@sha256:8fa55b2f3ddf97471ab6a767bfa3f37e6bad0986ba823e75fea57e2a2a5c3073
|
||||
ARG NODE_IMAGE=docker.io/library/node:24.18.0-bookworm@sha256:5711a0d445a1af54af9589066c646df387d1831a608226f4cd694fc59e745059
|
||||
ARG PLAYWRIGHT_IMAGE=mcr.microsoft.com/playwright:v1.61.1-noble@sha256:5b8f294aff9041b7191c34a4bab3ac270157a28774d4b0660e9743297b697e48
|
||||
|
||||
FROM ${RUST_IMAGE} AS rust-tools
|
||||
ADD --checksum=sha256:0c593171ba53aaaf699f8fd5d8d6661abcb004cfe2ffd01e206c7992909a4d05 https://static.crates.io/crates/cargo-nextest/cargo-nextest-0.9.140.crate /tmp/cargo-nextest-0.9.140.crate
|
||||
RUN mkdir /tmp/cargo-nextest \
|
||||
&& tar --extract --gzip --file /tmp/cargo-nextest-0.9.140.crate --directory /tmp/cargo-nextest \
|
||||
&& rustup component add clippy rustfmt \
|
||||
&& cargo install --jobs 4 --locked --path /tmp/cargo-nextest/cargo-nextest-0.9.140 \
|
||||
&& rm --recursive --force /tmp/cargo-nextest /tmp/cargo-nextest-0.9.140.crate
|
||||
|
||||
FROM rust-tools AS rust-check
|
||||
WORKDIR /workspace
|
||||
COPY Cargo.toml Cargo.lock rust-toolchain.toml ./
|
||||
COPY .config .config
|
||||
COPY crates crates
|
||||
CMD ["sh", "-c", "cargo fmt --all --check && cargo clippy --workspace --all-targets --all-features -- -D warnings && cargo nextest run --workspace --all-features && cargo test --workspace --doc"]
|
||||
|
||||
FROM ${NODE_IMAGE} AS node-runtime
|
||||
|
||||
FROM ${PLAYWRIGHT_IMAGE} AS web-dependencies
|
||||
COPY --from=node-runtime /usr/local/ /usr/local/
|
||||
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
||||
RUN corepack enable pnpm \
|
||||
&& corepack install --global [email protected]
|
||||
WORKDIR /workspace/web
|
||||
COPY web/package.json web/pnpm-lock.yaml web/pnpm-workspace.yaml ./
|
||||
COPY web/tools/svelte-check/package.json tools/svelte-check/package.json
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
FROM web-dependencies AS web-check
|
||||
COPY web/ ./
|
||||
|
||||
FROM web-check AS web-fast
|
||||
CMD ["sh", "-c", "pnpm check && pnpm lint && pnpm build && pnpm test:unit && pnpm test:component && pnpm test:e2e"]
|
||||
|
||||
FROM web-check AS web-full
|
||||
CMD ["sh", "-c", "pnpm check && pnpm lint && pnpm build && pnpm test:unit && pnpm test:component:full && pnpm test:e2e:full"]
|
||||
Loading…
Reference in a new issue