@@ -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+
2528jobs :
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()
0 commit comments