Skip to content

Commit d21571e

Browse files
authored
[GHA] Bump versions, create daily golangci-lint cache (#556)
## Summary We're going way above our GHA cache limits because every branch creates new cache keys for golangci-lint and our go builds. This means we rarely get cache hits. This bumps GHA versions and changes golangci-lint to use daily cache (instead of creating a new unique cache key on every branch) This also fixes a an issue where we're doing tests twice (once on push and once on pull request) ## How was it tested? CICD
1 parent 4c17933 commit d21571e

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

.github/workflows/cli-tests.yaml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ concurrency:
77

88
on:
99
pull_request:
10-
push:
11-
branches-ignore:
12-
- main
1310
paths-ignore:
1411
- 'docs/**'
1512
workflow_call:
@@ -36,14 +33,27 @@ jobs:
3633
timeout-minutes: 10
3734
steps:
3835
- uses: actions/checkout@v3
39-
- uses: actions/setup-go@v3
36+
- uses: actions/setup-go@v3.5.0
4037
with:
4138
go-version-file: ./go.mod
42-
cache: false # use golangci cache instead
39+
- name: Get current time
40+
uses: josStorer/[email protected]
41+
id: current-time
42+
- name: Mount golangci-lint cache
43+
uses: actions/cache@v3
44+
with:
45+
path: |
46+
~/.cache/golangci-lint
47+
~/.cache/go-build
48+
~/go/pkg
49+
key: golangci-lint-cache-${{ runner.os }}-${{ steps.current-time.outputs.day }}
50+
restore-keys: |
51+
golangci-lint-cache-${{ runner.os }}-
4352
- name: golangci-lint
44-
uses: golangci/golangci-lint-action@v3.2.0
53+
uses: golangci/golangci-lint-action@v3.4.0
4554
with:
4655
args: "--out-${NO_FUTURE}format colored-line-number --timeout=10m"
56+
skip-cache: true
4757

4858
test:
4959
strategy:
@@ -53,7 +63,7 @@ jobs:
5363
timeout-minutes: 15
5464
steps:
5565
- uses: actions/checkout@v3
56-
- uses: actions/setup-go@v3
66+
- uses: actions/setup-go@v3.5.0
5767
with:
5868
go-version-file: ./go.mod
5969
cache: true
@@ -84,7 +94,7 @@ jobs:
8494
runs-on: ubuntu-latest
8595
steps:
8696
- uses: actions/checkout@v3
87-
- uses: actions/setup-go@v3
97+
- uses: actions/setup-go@v3.5.0
8898
with:
8999
go-version-file: ./go.mod
90100
cache: true

0 commit comments

Comments
 (0)