ci: Ignore cache to pick latest matching go ver

Instead of requiring major.minor.x, it makes sense, in our CI,
to test major.minor.<latest>.

Without this, it is possible that the CI has a cached version
which is not yet the latest version.

This is a problem, as the current cached version on some workers
is 1.18.5, which has a CVE. Forcing the latest would fix it.
This commit is contained in:
Jean-Philippe Evrard
2022-09-14 16:38:32 +02:00
parent c20a5c2da9
commit 788e351a18
4 changed files with 18 additions and 9 deletions

View File

@@ -21,7 +21,8 @@ jobs:
- name: Ensure go version
uses: actions/setup-go@v3
with:
go-version: "${{ steps.awk_gomod.outputs.version }}.x"
go-version: "${{ steps.awk_gomod.outputs.version }}"
check-latest: true
- name: Login to DockerHub
uses: docker/login-action@v2

View File

@@ -18,7 +18,8 @@ jobs:
- name: Ensure go version
uses: actions/setup-go@v3
with:
go-version: "${{ steps.awk_gomod.outputs.version }}.x"
go-version: "${{ steps.awk_gomod.outputs.version }}"
check-latest: true
- name: run tests
run: go test -json ./... > test.json
- name: Annotate tests
@@ -48,7 +49,8 @@ jobs:
- name: Ensure go version
uses: actions/setup-go@v3
with:
go-version: "${{ steps.awk_gomod.outputs.version }}.x"
go-version: "${{ steps.awk_gomod.outputs.version }}"
check-latest: true
- name: Lint cmd folder
uses: Jerome1337/golint-action@v1.0.2
with:
@@ -87,7 +89,8 @@ jobs:
- name: Ensure go version
uses: actions/setup-go@v3
with:
go-version: "${{ steps.awk_gomod.outputs.version }}.x"
go-version: "${{ steps.awk_gomod.outputs.version }}"
check-latest: true
- run: make DH_ORG="${{ github.repository_owner }}" VERSION="${{ github.sha }}" image
- uses: Azure/container-scan@v0
env:
@@ -122,7 +125,8 @@ jobs:
- name: Ensure go version
uses: actions/setup-go@v3
with:
go-version: "${{ steps.awk_gomod.outputs.version }}.x"
go-version: "${{ steps.awk_gomod.outputs.version }}"
check-latest: true
- name: Build artifacts
run: |
make DH_ORG="${{ github.repository_owner }}" VERSION="${{ github.sha }}" image
@@ -193,7 +197,8 @@ jobs:
- name: Ensure go version
uses: actions/setup-go@v3
with:
go-version: "${{ steps.awk_gomod.outputs.version }}.x"
go-version: "${{ steps.awk_gomod.outputs.version }}"
check-latest: true
- name: Build artifacts
run: |
make DH_ORG="${{ github.repository_owner }}" VERSION="${{ github.sha }}" image

View File

@@ -21,7 +21,8 @@ jobs:
- name: Ensure go version
uses: actions/setup-go@v3
with:
go-version: "${{ steps.awk_gomod.outputs.version }}.x"
go-version: "${{ steps.awk_gomod.outputs.version }}"
check-latest: true
- name: Find current tag version
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
id: tags

View File

@@ -61,7 +61,8 @@ jobs:
- name: Ensure go version
uses: actions/setup-go@v3
with:
go-version: "${{ steps.awk_gomod.outputs.version }}.x"
go-version: "${{ steps.awk_gomod.outputs.version }}"
check-latest: true
- run: make DH_ORG="${{ github.repository_owner }}" VERSION="${{ github.sha }}" image
- uses: Azure/container-scan@v0
env:
@@ -90,7 +91,8 @@ jobs:
- name: Ensure go version
uses: actions/setup-go@v3
with:
go-version: "${{ steps.awk_gomod.outputs.version }}.x"
go-version: "${{ steps.awk_gomod.outputs.version }}"
check-latest: true
- name: "Workaround 'Failed to attach 1 to compat systemd cgroup /actions_job/...' on gh actions"
run: |