diff --git a/Dockerfile b/Dockerfile index e4f3077..17f76de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Cache dependencies first COPY go.mod go.sum ./ +RUN go mod edit -dropreplace gitea.maximumdirect.net/ejr/feedkit RUN --mount=type=cache,target=/go/pkg/mod \ go mod download @@ -31,7 +32,12 @@ ENV CGO_ENABLED=${CGO_ENABLED} \ GOOS=${TARGETOS} \ GOARCH=${TARGETARCH} -# Build your cmd entrypoint +# Run tests before building the final binary +RUN --mount=type=cache,target=/go/pkg/mod \ + --mount=type=cache,target=/root/.cache/go-build \ + go test ./... + +# Build the cmd entrypoint RUN --mount=type=cache,target=/root/.cache/go-build \ go build \ -trimpath \