Skip to content

Commit

Permalink
feat: optimize cache on +generate
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Oct 16, 2024
1 parent 8c63822 commit 9580de2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ IMPORT github.com/formancehq/stack/releases:main AS releases

FROM core+base-image

CACHE --persist --sharing=shared /go

sources:
FROM core+builder-image
CACHE --persist --sharing=shared /go/pkg
WORKDIR /src/pkg/client
COPY pkg/client/go.mod pkg/client/go.sum ./
RUN go mod download
Expand All @@ -20,9 +21,10 @@ sources:
SAVE ARTIFACT /src

generate:
FROM +sources
FROM core+builder-image
RUN apk update && apk add openjdk11
DO --pass-args core+GO_INSTALL --package=go.uber.org/mock/mockgen@latest
COPY (+sources/*) /src
WORKDIR /src
DO --pass-args core+GO_GENERATE
SAVE ARTIFACT internal AS LOCAL internal
Expand Down

0 comments on commit 9580de2

Please sign in to comment.