chore: Update macOS CircleCI runner (#13932)
This commit is contained in:
parent
1b27556feb
commit
3996139dfd
|
|
@ -13,7 +13,7 @@ executors:
|
|||
GOFLAGS: -p=4
|
||||
mac:
|
||||
working_directory: '~/go/src/github.com/influxdata/telegraf'
|
||||
resource_class: macos.x86.medium.gen2
|
||||
resource_class: macos.m1.medium.gen1
|
||||
macos:
|
||||
xcode: 14.2.0
|
||||
environment:
|
||||
|
|
@ -275,12 +275,13 @@ jobs:
|
|||
- checkout
|
||||
- restore_cache:
|
||||
name: "Restore Go caches"
|
||||
key: darwin-amd64-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ 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: darwin-amd64-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }}
|
||||
key: darwin-arm64-go<< parameters.goversion >>-cache-<< parameters.cache_version >>-{{ checksum "go.sum" }}
|
||||
paths:
|
||||
- '~/go/pkg/mod'
|
||||
- '~/Library/Caches/golangci-lint'
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ func TestMinMax(t *testing.T) {
|
|||
InMin: -5,
|
||||
InMax: 0,
|
||||
OutMin: 1,
|
||||
OutMax: 9,
|
||||
OutMax: 10,
|
||||
Fields: []string{"test3", "test4"},
|
||||
},
|
||||
},
|
||||
|
|
@ -84,13 +84,13 @@ func TestMinMax(t *testing.T) {
|
|||
}, time.Unix(0, 0)),
|
||||
testutil.MustMetric("Name3", map[string]string{},
|
||||
map[string]interface{}{
|
||||
"test3": float64(4.2),
|
||||
"test4": float64(9),
|
||||
"test3": float64(4.6),
|
||||
"test4": float64(10),
|
||||
}, time.Unix(0, 0)),
|
||||
testutil.MustMetric("Name4", map[string]string{},
|
||||
map[string]interface{}{
|
||||
"test3": float64(1),
|
||||
"test4": float64(8.2),
|
||||
"test4": float64(9.1),
|
||||
}, time.Unix(0, 0)),
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4,21 +4,28 @@ set -eux
|
|||
|
||||
OS=$1
|
||||
EXE=$2
|
||||
VERSION="1.7.0"
|
||||
VERSION="1.10.1"
|
||||
ARCH=$(uname -m)
|
||||
|
||||
WINDOWS_SHA="7ae12ddb171375f0c14d6a09dd27a5c1d1fc72edeea674e3d6e7489a533b40c1"
|
||||
DARWIN_SHA="a8e2351604882af1a67601cbeeacdcfa9b17fc2f6fbac291cf5d434efdf2d85b"
|
||||
LINUX_SHA="b5c98cc408c75e76a097354d9487dca114996e821b3af29a0442aa6c9159bd40"
|
||||
WINDOWS_SHA="3a409d05e6d0b89b7860b3a1d66bd855831a276ac25a05d33700f330f554d315"
|
||||
DARWIN_ARM64_SHA="01be1b28f7c2558af6191050671a97e783eab5ceb813ea8bfac739d5759de596"
|
||||
LINUX_SHA="44be2c02d4cf99cdd61edcb27851ef98ef8724a2ae3355b438bd108e9abb9056"
|
||||
|
||||
if [ "$ARCH" = 'arm64' ]; then
|
||||
GO_ARCH="arm64"
|
||||
elif [ "$ARCH" = 'x86_64' ]; then
|
||||
GO_ARCH="amd64"
|
||||
fi
|
||||
|
||||
setup_gotestsum () {
|
||||
echo "installing gotestsum"
|
||||
curl -L "https://github.com/gotestyourself/gotestsum/releases/download/v${VERSION}/gotestsum_${VERSION}_${OS}_amd64.tar.gz" --output gotestsum.tar.gz
|
||||
curl -L "https://github.com/gotestyourself/gotestsum/releases/download/v${VERSION}/gotestsum_${VERSION}_${OS}_${GO_ARCH}.tar.gz" --output gotestsum.tar.gz
|
||||
|
||||
if [ "$OS" = "windows" ]; then
|
||||
SHA=$WINDOWS_SHA
|
||||
SHATOOL="sha256sum"
|
||||
elif [ "$OS" = "darwin" ]; then
|
||||
SHA=$DARWIN_SHA
|
||||
SHA=$DARWIN_ARM64_SHA
|
||||
SHATOOL="shasum --algorithm 256"
|
||||
elif [ "$OS" = "linux" ]; then
|
||||
SHA=$LINUX_SHA
|
||||
|
|
@ -39,7 +46,7 @@ if test -f "${EXE}"; then
|
|||
echo "$v is installed, required version is ${VERSION}"
|
||||
if [ "$v" != "gotestsum version ${VERSION}" ]; then
|
||||
setup_gotestsum
|
||||
${EXE} --version
|
||||
./"${EXE}" --version
|
||||
fi
|
||||
else
|
||||
setup_gotestsum
|
||||
|
|
|
|||
Loading…
Reference in New Issue