forked from influxdata/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "chore(tools): Cache rework for CircleCI (influxdata#14156)"
This reverts commit 4413991.
- Loading branch information
Showing
5 changed files
with
33 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,34 +37,15 @@ commands: | |
default: "gotestsum" | ||
cache_version: | ||
type: string | ||
default: "v1" | ||
default: "v2" | ||
goversion: | ||
type: string | ||
default: 1.21.5 | ||
steps: | ||
- check-changed-files-or-halt | ||
- when: | ||
condition: | ||
equal: [ windows, << parameters.os >> ] | ||
steps: | ||
- run: | ||
name: Remove Go and MinGW to avoid clashes after upgrade during cache restore | ||
command: | | ||
rm -rf '/c/Program Files/Go' | ||
rm -rf '/c/ProgramData/chocolatey/lib/mingw' | ||
- when: | ||
condition: | ||
equal: [ darwin, << parameters.os >> ] | ||
steps: | ||
- run: | ||
name: Ensure go directory is empty and have proper permissions before cache restore | ||
command: | | ||
sudo rm -rf '/usr/local/Cellar/go' | ||
sudo mkdir -p '/usr/local/Cellar/go' | ||
sudo chown -R $(id -u):$(id -g) '/usr/local/Cellar/go' | ||
- restore_cache: | ||
name: "Restore binaries from cache" | ||
key: go-bins-<< parameters.cache_version >>-<< parameters.os >>-<< parameters.arch >>-go<< parameters.goversion >>-{{ checksum "go.sum" }} | ||
key: << parameters.os >>-<< parameters.arch >>-go<< parameters.goversion >>-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
- when: | ||
condition: | ||
equal: [ linux, << parameters.os >> ] | ||
|
@@ -80,11 +61,10 @@ commands: | |
condition: | ||
equal: [ windows, << parameters.os >> ] | ||
steps: | ||
- run: rm -rf '/c/Program Files/Go' | ||
- run: choco feature enable -n allowGlobalConfirmation | ||
- run: git config --system core.longpaths true | ||
- run: 'sh ./scripts/installgo_windows.sh' | ||
- run: 'sh ./scripts/installmingw_windows.sh' | ||
- run: choco install make | ||
- run: choco install mingw --version=12.2.0.03042023 | ||
- run: go env | ||
- run: go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
- when: | ||
|
@@ -123,18 +103,8 @@ commands: | |
equal: [ "386", << parameters.arch >> ] | ||
steps: | ||
- run: echo 'export RACE="-race"' >> $BASH_ENV | ||
- when: | ||
condition: | ||
equal: [ windows, << parameters.os >> ] | ||
steps: | ||
- run: | | ||
export PATH="/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin:$PATH" | ||
GOARCH=<< parameters.arch >> ./<< parameters.gotestsum >> -- ${RACE} -short -cover -coverprofile=coverage.out ./... | ||
- unless: | ||
condition: | ||
equal: [ windows, << parameters.os >> ] | ||
steps: | ||
- run: GOARCH=<< parameters.arch >> ./<< parameters.gotestsum >> -- ${RACE} -short -cover -coverprofile=coverage.out ./... | ||
- run: | | ||
GOARCH=<< parameters.arch >> ./<< parameters.gotestsum >> -- ${RACE} -short -cover -coverprofile=coverage.out ./... | ||
- when: | ||
condition: | ||
and: | ||
|
@@ -157,7 +127,7 @@ commands: | |
steps: | ||
- save_cache: | ||
name: 'Saving binaries to cache' | ||
key: go-bins-<< parameters.cache_version >>-<< parameters.os >>-<< parameters.arch >>-go<< parameters.goversion >>-{{ checksum "go.sum" }} | ||
key: << parameters.os >>-<< parameters.arch >>-go<< parameters.goversion >>-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
paths: | ||
- '/go/src/github.com/influxdata/telegraf/gotestsum' | ||
- when: | ||
|
@@ -166,7 +136,7 @@ commands: | |
steps: | ||
- save_cache: | ||
name: 'Saving binaries to cache' | ||
key: go-bins-<< parameters.cache_version >>-<< parameters.os >>-<< parameters.arch >>-go<< parameters.goversion >>-{{ checksum "go.sum" }} | ||
key: << parameters.os >>-<< parameters.arch >>-go<< parameters.goversion >>-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
paths: | ||
- '~/go/src/github.com/influxdata/telegraf/gotestsum' | ||
- '/usr/local/Cellar/go' | ||
|
@@ -178,11 +148,10 @@ commands: | |
steps: | ||
- save_cache: | ||
name: 'Saving binaries to cache' | ||
key: go-bins-<< parameters.cache_version >>-<< parameters.os >>-<< parameters.arch >>-go<< parameters.goversion >>-{{ checksum "go.sum" }} | ||
key: << parameters.os >>-<< parameters.arch >>-go<< parameters.goversion >>-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
paths: | ||
- '~\project\gotestsum.exe' | ||
- 'C:\Program Files\Go' | ||
- 'C:\ProgramData\chocolatey\lib\mingw' | ||
package-build: | ||
parameters: | ||
type: | ||
|
@@ -232,12 +201,12 @@ jobs: | |
default: 1.21.5 | ||
cache_version: | ||
type: string | ||
default: "v1" | ||
default: "v2" | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
name: "Restore Go caches" | ||
key: go-caches-<< parameters.cache_version >>-linux-amd64-go<< parameters.goversion >>-{{ checksum "go.sum" }} | ||
key: linux-amd64-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
- check-changed-files-or-halt | ||
- run: ./scripts/make_docs.sh | ||
- run: 'make deps' | ||
|
@@ -247,7 +216,7 @@ jobs: | |
- test-go | ||
- save_cache: | ||
name: "Save Go caches" | ||
key: go-caches-<< parameters.cache_version >>-linux-amd64-go<< parameters.goversion >>-{{ checksum "go.sum" }} | ||
key: linux-amd64-go<< parameters.goversion >>-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
paths: | ||
- '/go/pkg/mod' | ||
- '~/.cache/golangci-lint' | ||
|
@@ -264,12 +233,12 @@ jobs: | |
default: 1.21.5 | ||
cache_version: | ||
type: string | ||
default: "v1" | ||
default: "v2" | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
name: "Restore Go caches" | ||
key: go-caches-<< parameters.cache_version >>-linux-386-go<< parameters.goversion >>-{{ checksum "go.sum" }} | ||
key: linux-386-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
- check-changed-files-or-halt | ||
- run: 'GOARCH=386 make deps' | ||
- run: 'GOARCH=386 make tidy' | ||
|
@@ -278,7 +247,7 @@ jobs: | |
arch: "386" | ||
- save_cache: | ||
name: "Save Go caches" | ||
key: go-caches-<< parameters.cache_version >>-linux-386-go<< parameters.goversion >>-{{ checksum "go.sum" }} | ||
key: linux-386-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
paths: | ||
- '/go/pkg/mod' | ||
- '~/.cache/golangci-lint' | ||
|
@@ -301,18 +270,18 @@ jobs: | |
default: 1.21.5 | ||
cache_version: | ||
type: string | ||
default: "v1" | ||
default: "v2" | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
name: "Restore Go caches" | ||
key: go-caches-<< parameters.cache_version >>-darwin-arm64-go<< parameters.goversion >>-{{ checksum "go.sum" }} | ||
key: darwin-arm64-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
- test-go: | ||
os: darwin | ||
arch: arm64 | ||
- save_cache: | ||
name: "Save Go caches" | ||
key: go-caches-<< parameters.cache_version >>-darwin-arm64-go<< parameters.goversion >>-{{ checksum "go.sum" }} | ||
key: darwin-arm64-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
paths: | ||
- '~/go/pkg/mod' | ||
- '~/Library/Caches/golangci-lint' | ||
|
@@ -324,7 +293,7 @@ jobs: | |
default: 1.21.5 | ||
cache_version: | ||
type: string | ||
default: "v1" | ||
default: "v2" | ||
executor: | ||
name: win/default | ||
shell: bash.exe | ||
|
@@ -333,13 +302,13 @@ jobs: | |
- checkout | ||
- restore_cache: | ||
name: "Restore Go caches" | ||
key: go-caches-<< parameters.cache_version >>-windows-amd64-go<< parameters.goversion >>-{{ checksum "go.sum" }} | ||
key: windows-amd64-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
- test-go: | ||
os: windows | ||
gotestsum: "gotestsum.exe" | ||
- save_cache: | ||
name: "Save Go caches" | ||
key: go-caches-<< parameters.cache_version >>-windows-amd64-go<< parameters.goversion >>-{{ checksum "go.sum" }} | ||
key: windows-amd64-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
paths: | ||
- '~\go\pkg\mod' | ||
- '~\AppData\Local\golangci-lint' | ||
|
@@ -353,18 +322,18 @@ jobs: | |
default: 1.21.5 | ||
cache_version: | ||
type: string | ||
default: "v1" | ||
default: "v2" | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
name: "Restore Go caches" | ||
key: go-caches-<< parameters.cache_version >>-linux-amd64-go<< parameters.goversion >>-{{ checksum "go.sum" }} | ||
key: linux-amd64-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
- check-changed-files-or-halt | ||
- run: 'make build_tools' | ||
- run: './tools/license_checker/license_checker -whitelist ./tools/license_checker/data/whitelist' | ||
- save_cache: | ||
name: "Save Go caches" | ||
key: go-caches-<< parameters.cache_version >>-linux-amd64-go<< parameters.goversion >>-{{ checksum "go.sum" }} | ||
key: linux-amd64-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
paths: | ||
- '/go/pkg/mod' | ||
- '~/.cache/golangci-lint' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.