File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 run : cargo test --features integration --test integration_rustfs
4040 - name : E2E tests (k3s + RustFS containers)
4141 run : cargo test --features e2e --test e2e_k3s
42+
43+ # Validates the Dockerfile and seeds the buildx GHA cache on the default
44+ # branch, so tag-triggered release builds can restore it (Actions cache is
45+ # isolated per ref except for the default branch).
46+ image-build :
47+ runs-on : ubuntu-latest
48+ steps :
49+ - uses : actions/checkout@v4
50+ - uses : docker/setup-buildx-action@v3
51+ - uses : docker/build-push-action@v6
52+ with :
53+ context : .
54+ push : false
55+ cache-from : type=gha
56+ cache-to : type=gha,mode=max
Original file line number Diff line number Diff line change 11[package ]
22name = " rustfs-operator"
3- version = " 0.2.1 "
3+ version = " 0.2.2 "
44edition = " 2024"
55rust-version = " 1.92"
66license = " MIT OR Apache-2.0"
Original file line number Diff line number Diff line change 1- FROM ghcr.io/openprojectx/dockerhub/library/rust:1.97.0-trixie AS builder
1+ FROM ghcr.io/openprojectx/dockerhub/library/rust:1.97.0-trixie AS base
2+
3+ # Normalize the manifest so routine version bumps don't invalidate the
4+ # dependency layer below.
5+ FROM base AS manifest
6+ COPY Cargo.toml /normalized/Cargo.toml
7+ RUN sed -i 's/^version = ".*"/version = "0.0.0"/' /normalized/Cargo.toml
8+
9+ FROM base AS builder
210WORKDIR /build
311
412# Dependency layer: build all dependencies against dummy sources so the
5- # layer is keyed on Cargo.toml only and survives source-code changes
6- # (persisted across CI runs by the buildx GHA cache).
7- COPY Cargo.toml ./
13+ # layer is keyed on the (normalized) Cargo.toml only and survives source
14+ # changes. Persisted across CI runs by the buildx GHA cache, seeded from
15+ # master builds (tag runs can only restore default-branch caches).
16+ COPY --from=manifest /normalized/Cargo.toml ./Cargo.toml
817RUN mkdir src \
918 && echo 'fn main() {}' > src/main.rs \
1019 && touch src/lib.rs \
1120 && cargo build --release --bin rustfs-operator \
1221 && rm -rf src
1322
23+ COPY Cargo.toml ./
1424COPY src ./src
1525# touch so cargo rebuilds the crate itself against the real sources
1626RUN touch src/main.rs src/lib.rs \
1727 && cargo build --release --bin rustfs-operator
1828
19- FROM debian:trixie-slim
29+ FROM ghcr.io/openprojectx/dockerhub/library/ debian:trixie-slim
2030RUN apt-get update \
2131 && apt-get install -y --no-install-recommends ca-certificates \
2232 && rm -rf /var/lib/apt/lists/* \
You can’t perform that action at this time.
0 commit comments