Skip to content

Commit 4e95aa0

Browse files
jongioCopilot
andauthored
ci: optimize GitHub Actions workflows (#30)
* ci: optimize GitHub Actions workflows - Add path filters to CI to reduce unnecessary runs - Add concurrency groups across all workflows - Add job timeouts - Pin govulncheck version - Remove redundant go mod download Co-authored-by: Copilot <[email protected]> * fix: use govulncheck@latest for Go 1.26 compatibility The pinned v1.1.3 version has x/tools incompatibility with Go 1.26. Using @latest ensures govulncheck stays compatible with the Go version. Co-authored-by: Copilot <[email protected]> * fix: bump Go version to 1.26.1 for security patches Go 1.26.0 has known stdlib vulnerabilities (GO-2026-4599, GO-2026-4600, GO-2026-4601, GO-2026-4602) fixed in Go 1.26.1. This was causing govulncheck failures in CI. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 60ded00 commit 4e95aa0

4 files changed

Lines changed: 27 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,27 @@ name: CI
33
on:
44
push:
55
branches: [main]
6+
paths: ['**.go', 'go.mod', 'go.sum', '.github/workflows/ci.yml']
67
pull_request:
78
branches: [main]
9+
paths: ['**.go', 'go.mod', 'go.sum', '.github/workflows/ci.yml']
810
workflow_dispatch:
911

12+
concurrency:
13+
group: ci-${{ github.ref }}
14+
cancel-in-progress: true
15+
1016
permissions:
1117
contents: read
1218

1319
jobs:
1420
test:
1521
name: Test
1622
runs-on: ${{ matrix.os }}
23+
timeout-minutes: 20
1724
strategy:
1825
matrix:
19-
go-version: ['1.26.0']
26+
go-version: ['1.26.1']
2027
os: [ubuntu-latest, windows-latest, macos-latest]
2128

2229
steps:
@@ -29,9 +36,6 @@ jobs:
2936
go-version: ${{ matrix.go-version }}
3037
cache: true
3138

32-
- name: Download dependencies
33-
run: go mod download
34-
3539
- name: Run go vet
3640
run: go vet ./...
3741

.github/workflows/codeql.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ permissions:
1313
security-events: write
1414
actions: read
1515

16+
concurrency:
17+
group: codeql-${{ github.ref }}
18+
cancel-in-progress: true
19+
1620
jobs:
1721
analyze:
1822
name: Analyze
1923
runs-on: ubuntu-latest
24+
timeout-minutes: 45
2025
permissions:
2126
contents: read
2227
security-events: write
@@ -29,7 +34,7 @@ jobs:
2934
- name: Set up Go
3035
uses: actions/setup-go@v6
3136
with:
32-
go-version: '1.26.0'
37+
go-version: '1.26.1'
3338
cache: true
3439

3540
- name: Initialize CodeQL

.github/workflows/govulncheck.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ on:
1111
permissions:
1212
contents: read
1313

14+
concurrency:
15+
group: govulncheck-${{ github.ref }}
16+
cancel-in-progress: true
17+
1418
jobs:
1519
govulncheck:
1620
name: Run govulncheck
1721
runs-on: ubuntu-latest
22+
timeout-minutes: 10
1823

1924
steps:
2025
- name: Checkout code
@@ -23,7 +28,7 @@ jobs:
2328
- name: Set up Go
2429
uses: actions/setup-go@v6
2530
with:
26-
go-version: '1.26.0'
31+
go-version: '1.26.1'
2732
cache: true
2833

2934
- name: Install govulncheck

.github/workflows/release.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,18 @@ permissions:
3333
issues: read
3434
pull-requests: write
3535

36+
concurrency:
37+
group: release
38+
cancel-in-progress: false
39+
3640
env:
37-
GO_VERSION: '1.26.0'
41+
GO_VERSION: '1.26.1'
3842

3943
jobs:
4044
test:
4145
name: Run Tests
4246
runs-on: ubuntu-latest
47+
timeout-minutes: 20
4348
steps:
4449
- name: Checkout code
4550
uses: actions/checkout@v4
@@ -53,9 +58,6 @@ jobs:
5358
cache: true
5459
cache-dependency-path: go.sum
5560

56-
- name: Download dependencies
57-
run: go mod download
58-
5961
- name: Verify dependencies
6062
run: go mod verify
6163

@@ -71,6 +73,7 @@ jobs:
7173
release:
7274
name: Create Release
7375
runs-on: ubuntu-latest
76+
timeout-minutes: 15
7477
needs: test
7578
steps:
7679
- name: Checkout code

0 commit comments

Comments
 (0)