Skip to content

Commit e63c423

Browse files
ci: bump min Go version to 1.23 (#1322)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
1 parent eea6aa7 commit e63c423

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+77
-130
lines changed

.github/workflows/build-and-test-msi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
- cron: '0 9 * * *'
1717
env:
1818
GO111MODULE: on
19-
GO_VERSION: '1.22.9'
19+
GO_VERSION: '1.23.7'
2020

2121
permissions:
2222
# This is required for configure-aws-credentials to request an OIDC JWT ID token to access AWS resources later on.

.github/workflows/build-pkg.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ permissions:
2626
contents: read
2727

2828
env:
29-
GO_VERSION: '1.22.9'
29+
GO_VERSION: '1.23.7'
3030

3131
jobs:
3232
build:

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ permissions:
4141

4242
env:
4343
DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG }}
44-
GO_VERSION: '1.22.8'
44+
GO_VERSION: '1.23.7'
4545

4646
concurrency:
4747
group: ${{ github.workflow }}-${{ github.ref }}
@@ -120,7 +120,7 @@ jobs:
120120
# Pin the version in case all the builds start to fail at the same time.
121121
# There may not be an automatic way (e.g., dependabot) to update a specific parameter of a GitHub Action,
122122
# so we will just update it manually whenever it makes sense (e.g., a feature that we want is added).
123-
version: v1.56.1
123+
version: v1.64.7
124124
args: --fix=false --timeout=5m
125125
- name: set GOOS env to darwin
126126
run: |
@@ -131,7 +131,7 @@ jobs:
131131
# Pin the version in case all the builds start to fail at the same time.
132132
# There may not be an automatic way (e.g., dependabot) to update a specific parameter of a GitHub Action,
133133
# so we will just update it manually whenever it makes sense (e.g., a feature that we want is added).
134-
version: v1.56.1
134+
version: v1.64.7
135135
args: --fix=false --timeout=5m --skip-dirs="(^|/)deps($|/)"
136136
shellcheck:
137137
name: ShellCheck

.github/workflows/e2e-linux.yaml

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ permissions:
2222
# This is required for actions/checkout
2323
contents: read
2424

25+
env:
26+
GO_VERSION: '1.23.7'
27+
2528
jobs:
2629
test:
2730
runs-on:
@@ -33,12 +36,27 @@ jobs:
3336
"${{ inputs.runner-type }}",
3437
]
3538
timeout-minutes: 60
39+
env:
40+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: 'true'
3641
outputs:
3742
has_creds: ${{ steps.vars.outputs.has_creds}}
3843
vm_report: ${{ steps.set-multiple-vars.outputs.VM_REPORT }}
3944
container_report: ${{ steps.set-multiple-vars.outputs.CONTAINER_REPORT }}
4045
vm_serial_report: ${{ steps.set-multiple-vars.outputs.VM_SERIAL_REPORT }}
4146
steps:
47+
- name: Allow Node16 on AL2
48+
if: ${{ (startsWith(inputs.os, 'amazon') && inputs.version == '2' ) }}
49+
run: |
50+
echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV
51+
echo "ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION=node16" >> $GITHUB_ENV
52+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
53+
# Later checkout versiosn use node which doesn't run on AL2
54+
if: ${{ (startsWith(inputs.os, 'amazon') && inputs.version == '2' ) }}
55+
with:
56+
# We need to get all the git tags to make version injection work. See VERSION in Makefile for more detail.
57+
fetch-depth: 0
58+
persist-credentials: false
59+
submodules: recursive
4260
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4361
# checkout uses node version 20, which doesn't run on AL2
4462
if: ${{ ! (startsWith(inputs.os, 'amazon') && inputs.version == '2' ) }}
@@ -47,17 +65,17 @@ jobs:
4765
fetch-depth: 0
4866
persist-credentials: false
4967
submodules: recursive
50-
- name: Check repo out manually
68+
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
69+
# Later setup-go versions use node which doesn't run on AL2
5170
if: ${{ (startsWith(inputs.os, 'amazon') && inputs.version == '2' ) }}
52-
run: |
53-
git clone https://github.com/${GITHUB_REPOSITORY}.git .
54-
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
55-
git config --add remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
56-
git config --add remote.origin.fetch "+refs/tags/*:refs/tags/*"
57-
git config --add remote.origin.fetch "+${GITHUB_SHA}:${GITHUB_REF}"
58-
fi
59-
git fetch --prune origin
60-
git checkout ${GITHUB_SHA}
71+
with:
72+
go-version: ${{ env.GO_VERSION }}
73+
cache: false
74+
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
75+
if: ${{ ! (startsWith(inputs.os, 'amazon') && inputs.version == '2' ) }}
76+
with:
77+
go-version: ${{ env.GO_VERSION }}
78+
cache: false
6179
- name: Set output variables
6280
id: vars
6381
run: |
@@ -103,10 +121,13 @@ jobs:
103121
run: |
104122
git status
105123
git clean -f -d
124+
106125
# required by one of the tests which uses SSH_AUTH_SOCK
107126
eval "$(ssh-agent -s)"
108-
INSTALLED=true REGISTRY=${{ steps.vars.outputs.has_creds == true && env.REGISTRY || '' }} sudo -E make test-e2e-container
109-
INSTALLED=true REGISTRY=${{ steps.vars.outputs.has_creds == true && env.REGISTRY || '' }} sudo -E make test-e2e-vm
127+
128+
# Preserve path so Go from actions/setup-go is used; not the system installed golang.
129+
sudo -E env "PATH=$PATH" INSTALLED=true REGISTRY=${{ steps.vars.outputs.has_creds == true && env.REGISTRY || '' }} make test-e2e-container
130+
sudo -E env "PATH=$PATH" INSTALLED=true REGISTRY=${{ steps.vars.outputs.has_creds == true && env.REGISTRY || '' }} make test-e2e-vm
110131
- name: Change ownership of reports
111132
if: always()
112133
run: |
@@ -137,10 +158,7 @@ jobs:
137158
with:
138159
name: linux-${{ inputs.version }}-test-e2e-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports
139160
path: ${{ github.workspace }}/reports/${{ github.run_id }}-${{ github.run_attempt }}-*.json
140-
- name: Clean up repo AL2
141-
if: ${{ (startsWith(inputs.os, 'amazon') && inputs.version == '2' && always() ) }}
142-
run: |
143-
rm -rf "${GITHUB_WORKSPACE}"
161+
144162
upload-e2e-test-reports:
145163
needs: test
146164
if: always()

.github/workflows/e2e-macos.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ permissions:
2323
contents: read
2424

2525
env:
26-
GO_VERSION: '1.22.9'
26+
GO_VERSION: '1.23.7'
2727

2828
jobs:
2929
test:

.github/workflows/e2e-windows.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ permissions:
2020
contents: read
2121

2222
env:
23-
GO_VERSION: '1.22.9'
23+
GO_VERSION: '1.23.7'
2424

2525
jobs:
2626
test:

.github/workflows/test-pkg.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ permissions:
2626
contents: read
2727

2828
env:
29-
GO_VERSION: '1.22.9'
29+
GO_VERSION: '1.23.7'
3030

3131
jobs:
3232
test:

.github/workflows/upload-build-to-S3.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
env:
66
GO111MODULE: on
7-
GO_VERSION: '1.22.9'
7+
GO_VERSION: '1.23.7'
88

99
permissions:
1010
# This is required for configure-aws-credentials to request an OIDC JWT ID token to access AWS resources later on.

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ linters-settings:
2424
checks: ["all", "-ST1003"]
2525
linters:
2626
enable:
27+
- copyloopvar
2728
- errname
2829
- errorlint
29-
- exportloopref
3030
- forcetypeassert
3131
- gocritic
3232
- godot

benchmark/benchmark.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package benchmark
77
import (
88
"flag"
99
"fmt"
10+
"math/big"
1011
"os"
1112
"path/filepath"
1213
"sync"
@@ -149,12 +150,12 @@ func measureMetrics(targetFunc func()) (Metrics, error) { //nolint:unparam // ma
149150
avgCPU := sumCPU / float64(len(cpuUsage))
150151
totalCPUTime := time.Since(startTime)
151152

152-
diskUsageDelta := int64(diskUsageBefore - diskUsageAfter)
153+
diskUsageDelta := new(big.Int).SetUint64(diskUsageBefore - diskUsageAfter)
153154

154155
return Metrics{
155156
PeakCPUUsage: peakCPU,
156157
AverageCPUUsage: avgCPU,
157158
TotalCPUTime: totalCPUTime,
158-
DiskUsageDelta: diskUsageDelta,
159+
DiskUsageDelta: diskUsageDelta.Int64(),
159160
}, nil
160161
}

0 commit comments

Comments
 (0)