Skip to content

Commit

Permalink
Adding Go 1.23 to job maxtix
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosroman committed Feb 5, 2025
1 parent 61231fe commit 0f6d920
Showing 1 changed file with 22 additions and 41 deletions.
63 changes: 22 additions & 41 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,26 @@
# We use github actions to test the code on windows and linux amd64. Circleci is used for linux arm64.
---
# We use github actions to test the code on windows and linux amd64.
# Circleci is used for linux arm64.
#
version: 2.1

orbs:
os-detect: circleci/os-detect@0.2
go: circleci/go@2.2.4

executors:
linux_arm64:
description: "arm64"
machine:
image: ubuntu-2204:2023.07.2
image: ubuntu-2404:current
resource_class: arm.medium

commands:
install_go_linux:
parameters:
version:
type: string
steps:
- os-detect/init # this setup the '$SUDO' variable
- run:
name: "install Golang linux"
command: |
if command -v go >/dev/null; then
if go version | grep -q -F "go<< parameters.version >> "; then
echo "Binary already exists, skipping download."
exit 0
fi
echo "Error different version of Go already installed: '`go version`' when requested was '<< parameters.version >>'"
$SUDO rm -rf /usr/local/go
$SUDO install "--owner=${USER}" -d /usr/local/go
fi
echo "Installing the requested version of Go."
curl --fail --location -sS "https://dl.google.com/go/go<<parameters.version >>.linux-arm64.tar.gz" \
| sudo tar --no-same-owner --strip-components=1 --gunzip -x -C /usr/local/go/
echo "export PATH=$PATH:/usr/local/go/bin" >> $BASH_ENV
$SUDO chown -R "$(whoami):" /usr/local/go
go version
run_tests:
steps:
- checkout
- run: go vet ./statsd/...
- run: go fmt ./statsd/...
- run: go test -v ./statsd/...
- run: go test -v -race ./statsd/...

jobs:
# Those allow us to have the os name in the job name. 'matrix' don't add static parameters to the name in the circleci
# UI.
tests_arm64:
working_directory: /home/circleci/.go_workspace/src/github.com/DataDog/datadog-go
environment:
Expand All @@ -61,9 +29,10 @@ jobs:
parameters:
go-version:
type: string
docker:
- image: cimg/go:{{ parameters.go-version }}
steps:
- install_go_linux:
version: << parameters.go-version >>
- checkout
- run_tests

workflows:
Expand All @@ -72,4 +41,16 @@ workflows:
- tests_arm64:
matrix:
parameters:
go-version: ["1.13", "1.14", "1.15", "1.16", "1.17", "1.18", "1.19", "1.20", "1.21.5"]
go-version: [
"1.13",
"1.14",
"1.15",
"1.16",
"1.17",
"1.18",
"1.19",
"1.20",
"1.21",
"1.22",
"1.23",
]

0 comments on commit 0f6d920

Please sign in to comment.