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: Cache rework for
.circleci
jobs (influxdata#13753)"
This reverts commit 904db01.
- Loading branch information
Showing
2 changed files
with
33 additions
and
99 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,66 +37,51 @@ commands: | |
default: "gotestsum" | ||
cache_version: | ||
type: string | ||
default: "v2" | ||
goversion: | ||
type: string | ||
default: 1.21.5 | ||
default: "v3" | ||
steps: | ||
- checkout | ||
- check-changed-files-or-halt | ||
- restore_cache: | ||
name: "Restore binaries from cache" | ||
key: << parameters.os >>-<< parameters.arch >>-go<< parameters.goversion >>-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
- when: | ||
condition: | ||
equal: [ linux, << parameters.os >> ] | ||
steps: | ||
- restore_cache: | ||
key: linux-go-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
- attach_workspace: | ||
at: '/go' | ||
- when: | ||
condition: | ||
equal: [ darwin, << parameters.os >> ] | ||
steps: | ||
- restore_cache: | ||
key: darwin-go-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
- run: 'sh ./scripts/installgo_mac.sh' | ||
- when: | ||
condition: | ||
equal: [ windows, << parameters.os >> ] | ||
steps: | ||
- run: rm -rf '/c/Program Files/Go' | ||
- run: rm -rf /c/Go | ||
- run: choco feature enable -n allowGlobalConfirmation | ||
- restore_cache: | ||
key: windows-go-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
- run: 'sh ./scripts/installgo_windows.sh' | ||
- run: choco install mingw --version=12.2.0.03042023 | ||
- run: go env | ||
- run: go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
- run: choco install mingw | ||
- run: go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
- when: | ||
condition: | ||
equal: [ linux, << parameters.os >> ] | ||
steps: | ||
- run: | ||
name: golangci-lint cache status | ||
command: GOGC=20 /go/bin/golangci-lint cache status | ||
- run: | ||
name: golangci-lint run | ||
command: GOGC=20 /go/bin/golangci-lint run --verbose | ||
- run: GOGC=20 /go/bin/golangci-lint run --verbose | ||
- when: | ||
condition: | ||
equal: [ darwin, << parameters.os >> ] | ||
steps: | ||
- run: | ||
name: golangci-lint cache status | ||
command: $HOME/go/bin/golangci-lint cache status | ||
- run: | ||
name: golangci-lint run | ||
command: $HOME/go/bin/golangci-lint run --verbose | ||
- run: $HOME/go/bin/golangci-lint run --verbose | ||
- when: | ||
condition: | ||
equal: [ windows, << parameters.os >> ] | ||
steps: | ||
- run: | ||
name: golangci-lint cache status | ||
command: $HOME/go/bin/golangci-lint.exe cache status | ||
- run: | ||
name: golangci-lint run | ||
command: $HOME/go/bin/golangci-lint.exe run --verbose | ||
- run: $HOME/go/bin/golangci-lint.exe run --verbose | ||
- run: ./scripts/install_gotestsum.sh << parameters.os >> << parameters.gotestsum >> | ||
- unless: | ||
condition: | ||
|
@@ -126,19 +111,19 @@ commands: | |
equal: [ linux, << parameters.os >> ] | ||
steps: | ||
- save_cache: | ||
name: 'Saving binaries to cache' | ||
key: << parameters.os >>-<< parameters.arch >>-go<< parameters.goversion >>-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
name: 'Saving cache' | ||
key: linux-go-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
paths: | ||
- '/go/src/github.com/influxdata/telegraf/gotestsum' | ||
- '~/go/src/github.com/influxdata/telegraf/gotestsum' | ||
- when: | ||
condition: | ||
equal: [ darwin, << parameters.os >> ] | ||
steps: | ||
- save_cache: | ||
name: 'Saving binaries to cache' | ||
key: << parameters.os >>-<< parameters.arch >>-go<< parameters.goversion >>-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
name: 'Saving cache' | ||
key: darwin-go-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
paths: | ||
- '~/go/src/github.com/influxdata/telegraf/gotestsum' | ||
- '/go/src/github.com/influxdata/telegraf/gotestsum' | ||
- '/usr/local/Cellar/go' | ||
- '/usr/local/bin/go' | ||
- '/usr/local/bin/gofmt' | ||
|
@@ -147,11 +132,11 @@ commands: | |
equal: [ windows, << parameters.os >> ] | ||
steps: | ||
- save_cache: | ||
name: 'Saving binaries to cache' | ||
key: << parameters.os >>-<< parameters.arch >>-go<< parameters.goversion >>-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
name: 'Saving cache' | ||
key: windows-go-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
paths: | ||
- '~\project\gotestsum.exe' | ||
- 'C:\Program Files\Go' | ||
- 'C:\Go' | ||
- 'C:\Users\circleci\project\gotestsum.exe' | ||
package-build: | ||
parameters: | ||
type: | ||
|
@@ -191,22 +176,17 @@ commands: | |
root: './build' | ||
paths: | ||
- 'dist' | ||
|
||
jobs: | ||
test-go-linux: | ||
executor: telegraf-ci | ||
parameters: | ||
goversion: | ||
type: string | ||
default: 1.21.5 | ||
cache_version: | ||
type: string | ||
default: "v2" | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
name: "Restore Go caches" | ||
key: linux-amd64-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
key: go-mod-v1-{{ checksum "go.sum" }} | ||
- check-changed-files-or-halt | ||
- run: ./scripts/make_docs.sh | ||
- run: 'make deps' | ||
|
@@ -215,43 +195,30 @@ jobs: | |
- run: 'make check-deps' | ||
- test-go | ||
- save_cache: | ||
name: "Save Go caches" | ||
key: linux-amd64-go<< parameters.goversion >>-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
name: 'go module cache' | ||
key: go-mod-v1-{{ checksum "go.sum" }} | ||
paths: | ||
- '/go/pkg/mod' | ||
- '~/.cache/golangci-lint' | ||
- '~/.cache/go-build' | ||
- persist_to_workspace: | ||
root: '/go' | ||
paths: | ||
- '*' | ||
test-go-linux-386: | ||
executor: telegraf-ci | ||
parameters: | ||
goversion: | ||
type: string | ||
default: 1.21.5 | ||
cache_version: | ||
type: string | ||
default: "v2" | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
name: "Restore Go caches" | ||
key: linux-386-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
key: go-mod-v1-{{ checksum "go.sum" }} | ||
- check-changed-files-or-halt | ||
- run: 'GOARCH=386 make deps' | ||
- run: 'GOARCH=386 make tidy' | ||
- run: 'GOARCH=386 make check' | ||
- test-go: | ||
arch: "386" | ||
- save_cache: | ||
name: "Save Go caches" | ||
key: linux-386-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
paths: | ||
- '/go/pkg/mod' | ||
- '~/.cache/golangci-lint' | ||
- '~/.cache/go-build' | ||
test-integration: | ||
machine: | ||
image: ubuntu-2204:current | ||
|
@@ -265,32 +232,14 @@ jobs: | |
test-go-mac: | ||
executor: mac | ||
parameters: | ||
goversion: | ||
type: string | ||
default: 1.21.5 | ||
cache_version: | ||
type: string | ||
default: "v2" | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
name: "Restore Go caches" | ||
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: darwin-arm64-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
paths: | ||
- '~/go/pkg/mod' | ||
- '~/Library/Caches/golangci-lint' | ||
- '~/Library/Caches/go-build' | ||
test-go-windows: | ||
parameters: | ||
goversion: | ||
type: string | ||
default: 1.21.5 | ||
cache_version: | ||
type: string | ||
default: "v2" | ||
|
@@ -299,45 +248,28 @@ jobs: | |
shell: bash.exe | ||
size: xlarge | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
name: "Restore Go caches" | ||
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: windows-amd64-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
paths: | ||
- '~\go\pkg\mod' | ||
- '~\AppData\Local\golangci-lint' | ||
- '~\AppData\Local\go-build' | ||
|
||
test-licenses: | ||
executor: telegraf-ci | ||
parameters: | ||
goversion: | ||
type: string | ||
default: 1.21.5 | ||
cache_version: | ||
type: string | ||
default: "v2" | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
name: "Restore Go caches" | ||
key: linux-amd64-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
key: go-mod-v1-{{ 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: linux-amd64-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }} | ||
name: 'go module cache' | ||
key: go-mod-v1-{{ checksum "go.sum" }} | ||
paths: | ||
- '/go/pkg/mod' | ||
- '~/.cache/golangci-lint' | ||
- '~/.cache/go-build' | ||
|
||
windows-package: | ||
parameters: | ||
|
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