Skip to content

Commit d8a6219

Browse files
committed
ci: improve caching
Improve cache usage for faster local ci runs. Signed-off-by: Francesco Canovai <[email protected]>
1 parent 2d5f381 commit d8a6219

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

Taskfile.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ tasks:
1616
cmds:
1717
- >
1818
GITHUB_REF= dagger -s call -m github.com/sagikazarmark/daggerverse/golangci-lint@${DAGGER_GOLANGCI_LINT_SHA}
19+
with-linter-cache --cache golangci-lint
20+
with-build-cache --cache go-build
21+
with-module-cache --cache go-mod
1922
run --source . --config .golangci.yml stdout
2023
sources:
2124
- ./**/*.go

containers/Dockerfile.plugin

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ COPY ../cmd/manager/main.go cmd/manager/main.go
1616
COPY ../api/ api/
1717
COPY ../internal/ internal/
1818

19+
ENV GOCACHE=/root/.cache/go-build
20+
ENV GOMODCACHE=/go/pkg/mod
21+
1922
# Build
2023
# the GOARCH has not a default value to allow the binary be built according to the host where the command
2124
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
@@ -45,4 +48,4 @@ WORKDIR /
4548
COPY --from=gobuilder /workspace/manager .
4649
USER 65532:65532
4750

48-
ENTRYPOINT ["/manager"]
51+
ENTRYPOINT ["/manager"]

containers/Dockerfile.sidecar

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ COPY ../go.sum go.sum
1717
# and so that source changes don't invalidate our downloaded layer
1818
RUN go mod download
1919

20+
ENV GOCACHE=/root/.cache/go-build
21+
ENV GOMODCACHE=/go/pkg/mod
22+
2023
# Copy the go source
2124
COPY ../cmd/manager/main.go cmd/manager/main.go
2225
COPY ../api/ api/

0 commit comments

Comments
 (0)