cache go mod in docker, speed up local

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2022-10-18 14:41:20 +02:00
parent e96bceed4c
commit 32c21a05f8
No known key found for this signature in database

View file

@ -31,6 +31,7 @@ test_integration_cli:
docker network create headscale-test || true docker network create headscale-test || true
docker run -t --rm \ docker run -t --rm \
--network headscale-test \ --network headscale-test \
-v ~/.cache/hs-integration-go:/go \
-v $$PWD:$$PWD -w $$PWD \ -v $$PWD:$$PWD -w $$PWD \
-v /var/run/docker.sock:/var/run/docker.sock golang:1 \ -v /var/run/docker.sock:/var/run/docker.sock golang:1 \
go test -failfast -tags integration_cli,integration -timeout 30m -count=1 ./... go test -failfast -tags integration_cli,integration -timeout 30m -count=1 ./...
@ -40,6 +41,7 @@ test_integration_derp:
docker network create headscale-test || true docker network create headscale-test || true
docker run -t --rm \ docker run -t --rm \
--network headscale-test \ --network headscale-test \
-v ~/.cache/hs-integration-go:/go \
-v $$PWD:$$PWD -w $$PWD \ -v $$PWD:$$PWD -w $$PWD \
-v /var/run/docker.sock:/var/run/docker.sock golang:1 \ -v /var/run/docker.sock:/var/run/docker.sock golang:1 \
go test -failfast -tags integration_derp,integration -timeout 30m -count=1 ./... go test -failfast -tags integration_derp,integration -timeout 30m -count=1 ./...
@ -49,6 +51,7 @@ test_integration_general:
docker network create headscale-test || true docker network create headscale-test || true
docker run -t --rm \ docker run -t --rm \
--network headscale-test \ --network headscale-test \
-v ~/.cache/hs-integration-go:/go \
-v $$PWD:$$PWD -w $$PWD \ -v $$PWD:$$PWD -w $$PWD \
-v /var/run/docker.sock:/var/run/docker.sock golang:1 \ -v /var/run/docker.sock:/var/run/docker.sock golang:1 \
go test -failfast -tags integration_general,integration -timeout 30m -count=1 ./... go test -failfast -tags integration_general,integration -timeout 30m -count=1 ./...
@ -58,6 +61,7 @@ test_integration_oidc:
docker network create headscale-test || true docker network create headscale-test || true
docker run -t --rm \ docker run -t --rm \
--network headscale-test \ --network headscale-test \
-v ~/.cache/hs-integration-go:/go \
-v $$PWD:$$PWD -w $$PWD \ -v $$PWD:$$PWD -w $$PWD \
-v /var/run/docker.sock:/var/run/docker.sock golang:1 \ -v /var/run/docker.sock:/var/run/docker.sock golang:1 \
go test -failfast -tags integration_oidc,integration -timeout 30m -count=1 ./... go test -failfast -tags integration_oidc,integration -timeout 30m -count=1 ./...