chore: Update macOS CircleCI runner (#13932)

This commit is contained in:
Joshua Powers 2023-09-21 07:40:26 -06:00 committed by GitHub
parent 1b27556feb
commit 3996139dfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 14 deletions

View File

@ -13,7 +13,7 @@ executors:
GOFLAGS: -p=4 GOFLAGS: -p=4
mac: mac:
working_directory: '~/go/src/github.com/influxdata/telegraf' working_directory: '~/go/src/github.com/influxdata/telegraf'
resource_class: macos.x86.medium.gen2 resource_class: macos.m1.medium.gen1
macos: macos:
xcode: 14.2.0 xcode: 14.2.0
environment: environment:
@ -275,12 +275,13 @@ jobs:
- checkout - checkout
- restore_cache: - restore_cache:
name: "Restore Go caches" 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: - test-go:
os: darwin os: darwin
arch: arm64
- save_cache: - save_cache:
name: "Save Go caches" 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: paths:
- '~/go/pkg/mod' - '~/go/pkg/mod'
- '~/Library/Caches/golangci-lint' - '~/Library/Caches/golangci-lint'

View File

@ -45,7 +45,7 @@ func TestMinMax(t *testing.T) {
InMin: -5, InMin: -5,
InMax: 0, InMax: 0,
OutMin: 1, OutMin: 1,
OutMax: 9, OutMax: 10,
Fields: []string{"test3", "test4"}, Fields: []string{"test3", "test4"},
}, },
}, },
@ -84,13 +84,13 @@ func TestMinMax(t *testing.T) {
}, time.Unix(0, 0)), }, time.Unix(0, 0)),
testutil.MustMetric("Name3", map[string]string{}, testutil.MustMetric("Name3", map[string]string{},
map[string]interface{}{ map[string]interface{}{
"test3": float64(4.2), "test3": float64(4.6),
"test4": float64(9), "test4": float64(10),
}, time.Unix(0, 0)), }, time.Unix(0, 0)),
testutil.MustMetric("Name4", map[string]string{}, testutil.MustMetric("Name4", map[string]string{},
map[string]interface{}{ map[string]interface{}{
"test3": float64(1), "test3": float64(1),
"test4": float64(8.2), "test4": float64(9.1),
}, time.Unix(0, 0)), }, time.Unix(0, 0)),
}, },
}, },

View File

@ -4,21 +4,28 @@ set -eux
OS=$1 OS=$1
EXE=$2 EXE=$2
VERSION="1.7.0" VERSION="1.10.1"
ARCH=$(uname -m)
WINDOWS_SHA="7ae12ddb171375f0c14d6a09dd27a5c1d1fc72edeea674e3d6e7489a533b40c1" WINDOWS_SHA="3a409d05e6d0b89b7860b3a1d66bd855831a276ac25a05d33700f330f554d315"
DARWIN_SHA="a8e2351604882af1a67601cbeeacdcfa9b17fc2f6fbac291cf5d434efdf2d85b" DARWIN_ARM64_SHA="01be1b28f7c2558af6191050671a97e783eab5ceb813ea8bfac739d5759de596"
LINUX_SHA="b5c98cc408c75e76a097354d9487dca114996e821b3af29a0442aa6c9159bd40" LINUX_SHA="44be2c02d4cf99cdd61edcb27851ef98ef8724a2ae3355b438bd108e9abb9056"
if [ "$ARCH" = 'arm64' ]; then
GO_ARCH="arm64"
elif [ "$ARCH" = 'x86_64' ]; then
GO_ARCH="amd64"
fi
setup_gotestsum () { setup_gotestsum () {
echo "installing 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 if [ "$OS" = "windows" ]; then
SHA=$WINDOWS_SHA SHA=$WINDOWS_SHA
SHATOOL="sha256sum" SHATOOL="sha256sum"
elif [ "$OS" = "darwin" ]; then elif [ "$OS" = "darwin" ]; then
SHA=$DARWIN_SHA SHA=$DARWIN_ARM64_SHA
SHATOOL="shasum --algorithm 256" SHATOOL="shasum --algorithm 256"
elif [ "$OS" = "linux" ]; then elif [ "$OS" = "linux" ]; then
SHA=$LINUX_SHA SHA=$LINUX_SHA
@ -39,7 +46,7 @@ if test -f "${EXE}"; then
echo "$v is installed, required version is ${VERSION}" echo "$v is installed, required version is ${VERSION}"
if [ "$v" != "gotestsum version ${VERSION}" ]; then if [ "$v" != "gotestsum version ${VERSION}" ]; then
setup_gotestsum setup_gotestsum
${EXE} --version ./"${EXE}" --version
fi fi
else else
setup_gotestsum setup_gotestsum