Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add cargo doc #748

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 43 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,54 @@ RUN --mount=type=cache,target=${CARGO_HOME}/registry \
cargo fetch

# CI stage for checks
FROM builder-base AS ci

FROM builder-base AS machete

RUN --mount=type=cache,target=${CARGO_HOME}/registry \
--mount=type=cache,target=${CARGO_HOME}/git \
--mount=type=cache,target=/app/target \
cargo machete
RUN touch machete-done

FROM builder-base AS clippy

RUN --mount=type=cache,target=${CARGO_HOME}/registry \
--mount=type=cache,target=${CARGO_HOME}/git \
--mount=type=cache,target=/app/target \
cargo clippy --workspace --benches --tests --examples --all-features --frozen -- -D warnings
RUN touch clippy-done

FROM builder-base AS nextest

RUN --mount=type=cache,target=${CARGO_HOME}/registry \
--mount=type=cache,target=${CARGO_HOME}/git \
--mount=type=cache,target=/app/target \
cargo machete && \
cargo fmt --all -- --check && \
cargo clippy --workspace --benches --tests --examples --all-features --frozen -- -D warnings && \
cargo nextest run --all-features --workspace --frozen
RUN touch nextest-done

FROM builder-base AS fmt

RUN --mount=type=cache,target=${CARGO_HOME}/registry \
--mount=type=cache,target=${CARGO_HOME}/git \
--mount=type=cache,target=/app/target \
cargo fmt --all -- --check
RUN touch fmt-done

FROM builder-base AS docs

RUN --mount=type=cache,target=${CARGO_HOME}/registry \
--mount=type=cache,target=${CARGO_HOME}/git \
--mount=type=cache,target=/app/target \
cargo doc --all-features --workspace --frozen --no-deps
RUN touch docs-done

FROM builder-base AS ci

COPY --from=machete /app/machete-done /app/machete-done
COPY --from=clippy /app/clippy-done /app/clippy-done
COPY --from=nextest /app/nextest-done /app/nextest-done
COPY --from=fmt /app/fmt-done /app/fmt-done
COPY --from=docs /app/docs-done /app/docs-done

# Release builder
FROM builder-base AS build-release
Expand Down
Loading