From: Matt Joiner Date: Mon, 2 Jun 2025 04:55:00 +0000 (+1000) Subject: Fix test Dockerfile X-Git-Tag: v1.59.0~86 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=8f57b73f6bfd1aa527e908ba24ca2d89ab76b3f3;p=btrtrc.git Fix test Dockerfile --- 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