From 8f57b73f6bfd1aa527e908ba24ca2d89ab76b3f3 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 2 Jun 2025 14:55:00 +1000 Subject: [PATCH] Fix test Dockerfile --- Dockerfile | 15 ++++++--------- justfile | 6 ++++++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2451b309..0705a259 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,32 +2,29 @@ FROM alpine -RUN apk add go fuse bash rustup git gcc musl-dev g++ +RUN apk add go fuse bash rustup git gcc musl-dev g++ just RUN rustup-init -y --profile minimal ENV PATH="/root/.cargo/bin:$PATH" WORKDIR /src -COPY . . -RUN git clone https://github.com/anacrolix/possum +ENV GOWORK=off -WORKDIR possum +COPY . . RUN git submodule update --init --recursive + RUN --mount=type=cache,target=/root/.cargo/registry \ --mount=type=cache,target=/root/.cargo/git \ --mount=type=cache,target=/src/possum/target \ - cargo build - -WORKDIR .. + just build-possum ARG GOCACHE=/root/.cache/go-build ARG GOMODCACHE=/root/go/pkg/mod RUN --mount=type=cache,target=$GOCACHE \ --mount=type=cache,target=$GOMODCACHE \ - CGO_LDFLAGS=possum/target/debug/libpossum.a \ - go test -failfast ./... + just test # # Can't use fuse inside Docker? Asks for modprobe fuse. diff --git a/justfile b/justfile index c3de1914..9a52ffba 100644 --- a/justfile +++ b/justfile @@ -3,3 +3,9 @@ check: act: act -j test --matrix go-version:'1.24' --env-file .empty.env + +test: build-possum + go test -race ./... + +build-possum: + cd storage/possum/lib && cargo build -- 2.51.0