mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-01-12 05:33:11 +01:00
ci: improve caching
Improve cache usage for faster local ci runs. Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
This commit is contained in:
parent
cef931a971
commit
bc483db22b
@ -16,6 +16,9 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- >
|
- >
|
||||||
GITHUB_REF= dagger -s call -m github.com/sagikazarmark/daggerverse/golangci-lint@${DAGGER_GOLANGCI_LINT_SHA}
|
GITHUB_REF= dagger -s call -m github.com/sagikazarmark/daggerverse/golangci-lint@${DAGGER_GOLANGCI_LINT_SHA}
|
||||||
|
with-linter-cache --cache golangci-lint
|
||||||
|
with-build-cache --cache go-build
|
||||||
|
with-module-cache --cache go-mod
|
||||||
run --source . --config .golangci.yml stdout
|
run --source . --config .golangci.yml stdout
|
||||||
sources:
|
sources:
|
||||||
- ./**/*.go
|
- ./**/*.go
|
||||||
|
|||||||
@ -16,6 +16,9 @@ COPY ../cmd/manager/main.go cmd/manager/main.go
|
|||||||
COPY ../api/ api/
|
COPY ../api/ api/
|
||||||
COPY ../internal/ internal/
|
COPY ../internal/ internal/
|
||||||
|
|
||||||
|
ENV GOCACHE=/root/.cache/go-build
|
||||||
|
ENV GOMODCACHE=/go/pkg/mod
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
# the GOARCH has not a default value to allow the binary be built according to the host where the command
|
# the GOARCH has not a default value to allow the binary be built according to the host where the command
|
||||||
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
|
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
|
||||||
|
|||||||
@ -17,6 +17,9 @@ COPY ../go.sum go.sum
|
|||||||
# and so that source changes don't invalidate our downloaded layer
|
# and so that source changes don't invalidate our downloaded layer
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|
||||||
|
ENV GOCACHE=/root/.cache/go-build
|
||||||
|
ENV GOMODCACHE=/go/pkg/mod
|
||||||
|
|
||||||
# Copy the go source
|
# Copy the go source
|
||||||
COPY ../cmd/manager/main.go cmd/manager/main.go
|
COPY ../cmd/manager/main.go cmd/manager/main.go
|
||||||
COPY ../api/ api/
|
COPY ../api/ api/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user