Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main go version bump #13408

Merged
merged 7 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
106 changes: 53 additions & 53 deletions .circleci/config.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions .circleci/config/commands/@caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ save_yarn_cache:
- ui/node_modules
# allows restoring go mod caches by incomplete prefix. This is useful when re-generating
# cache, but not when running builds and tests that require an exact match.
# TODO should we be including arch in cache key?
restore_go_mod_cache_permissive:
steps:
- restore_cache:
name: Restore closest matching go modules cache
keys:
- &gocachekey v1.3-{{checksum "go.sum"}}-{{checksum "sdk/go.sum"}}-{{checksum "api/go.sum"}}
- v1.3-{{checksum "go.sum"}}-{{checksum "sdk/go.sum"}}
- v1.3-{{checksum "go.sum"}}
- &gocachekey v1.4-{{checksum "go.sum"}}-{{checksum "sdk/go.sum"}}-{{checksum "api/go.sum"}}
- v1.4-{{checksum "go.sum"}}-{{checksum "sdk/go.sum"}}
- v1.4-{{checksum "go.sum"}}
restore_go_mod_cache:
steps:
- restore_cache:
Expand All @@ -32,7 +33,7 @@ save_go_mod_cache:
name: Save go modules cache
key: *gocachekey
paths:
- /go/pkg/mod
- /home/circleci/go/pkg/mod
refresh_go_mod_cache:
steps:
- restore_go_mod_cache_permissive
Expand Down
14 changes: 7 additions & 7 deletions .circleci/config/commands/go_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ parameters:
default: false
go_image:
type: string
default: "docker.mirror.hashicorp.services/circleci/golang:1.17.2-buster"
default: "docker.mirror.hashicorp.services/cimg/go:1.17.5"
use_docker:
type: boolean
default: false
Expand Down Expand Up @@ -139,15 +139,15 @@ steps:

# Run tests
test -d << parameters.cache_dir >> && docker cp << parameters.cache_dir >> testcontainer:/tmp/gocache
docker exec testcontainer sh -c 'mkdir -p /go/src/github.com/hashicorp/vault'
docker cp . testcontainer:/go/src/github.com/hashicorp/vault/
docker exec testcontainer sh -c 'mkdir -p /home/circleci/go/src/github.com/hashicorp/vault'
docker cp . testcontainer:/home/circleci/go/src/github.com/hashicorp/vault/
docker cp $DOCKER_CERT_PATH/ testcontainer:$DOCKER_CERT_PATH

# Copy the downloaded modules inside the container.
docker exec testcontainer sh -c 'mkdir -p /go/pkg'
docker cp "$(go env GOPATH)/pkg/mod" testcontainer:/go/pkg/mod
docker exec testcontainer sh -c 'mkdir -p /home/circleci/go/pkg'
docker cp "$(go env GOPATH)/pkg/mod" testcontainer:/home/circleci/go/pkg/mod

docker exec -w /go/src/github.com/hashicorp/vault/ \
docker exec -w /home/circleci/go/src/github.com/hashicorp/vault/ \
-e CIRCLECI -e VAULT_CI_GO_TEST_RACE \
-e GOCACHE=/tmp/gocache \
-e GO_TAGS \
Expand Down Expand Up @@ -185,7 +185,7 @@ steps:
name: Copy test results
when: always
command: |
docker cp testcontainer:/go/src/github.com/hashicorp/vault/test-results .
docker cp testcontainer:/home/circleci/go/src/github.com/hashicorp/vault/test-results .
docker cp testcontainer:/tmp/gocache << parameters.cache_dir >>
- when:
condition: << parameters.save_cache >>
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config/commands/setup-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ steps:
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go${GO_VERSION}.linux-amd64.tar.gz"
rm -f "go${GO_VERSION}.linux-amd64.tar.gz"
GOPATH="/go"
GOPATH="/home/circleci/go"
mkdir $GOPATH 2>/dev/null || { sudo mkdir $GOPATH && sudo chmod 777 $GOPATH; }
echo "export GOPATH='$GOPATH'" >> "$BASH_ENV"
echo "export PATH='$PATH:$GOPATH/bin:/usr/local/go/bin'" >> "$BASH_ENV"
Expand Down