Fix Go version matrix and coverage calculation fragility [FRE-4695]
- Update matrix from 1.21.x/1.22.x to 1.23.x to match go.mod - Replace grep -oP with portable awk for coverage parsing - Update security-scan job to use 1.23.x Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [1.21.x, 1.22.x]
|
go-version: [1.23.x]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -42,7 +42,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Calculate coverage
|
- name: Calculate coverage
|
||||||
run: |
|
run: |
|
||||||
TOTAL=$(go test -cover ./... 2>&1 | grep -oP '\d+\.\d+%$' | head -1 | tr -d '%')
|
TOTAL=$(go test -cover ./... 2>&1 | awk '/^ok /{for(i=1;i<=NF;i++) if($i~/%$/) print $i}' | head -1 | tr -d '%')
|
||||||
echo "Coverage: ${TOTAL}"
|
echo "Coverage: ${TOTAL}"
|
||||||
if [ -z "$TOTAL" ]; then
|
if [ -z "$TOTAL" ]; then
|
||||||
echo "No coverage data found"
|
echo "No coverage data found"
|
||||||
@@ -74,7 +74,7 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.21.x
|
go-version: 1.23.x
|
||||||
|
|
||||||
- name: Run GoSec
|
- name: Run GoSec
|
||||||
uses: securego/gosec@v2
|
uses: securego/gosec@v2
|
||||||
|
|||||||
Reference in New Issue
Block a user