Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 5780bc5

Browse files
committed
ci: use cache feature from actions/setup-go
Signed-off-by: CrazyMax <[email protected]>
1 parent 1dce987 commit 5780bc5

File tree

7 files changed

+33
-62
lines changed

7 files changed

+33
-62
lines changed

.github/workflows/aci-tests.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,20 @@ jobs:
2929
needs: check-optional-tests
3030
if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-aci == 'true'
3131
steps:
32+
- name: Checkout code into the Go module directory
33+
uses: actions/checkout@v3
34+
3235
- name: Set up Go
3336
uses: actions/setup-go@v3
3437
with:
3538
go-version: ${{ env.GO_VERSION }}
39+
cache: true
3640

3741
- name: Setup docker CLI
3842
run: |
3943
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
4044
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
4145
42-
- name: Checkout code into the Go module directory
43-
uses: actions/checkout@v2
44-
45-
- uses: actions/cache@v2
46-
with:
47-
path: ~/go/pkg/mod
48-
key: go-${{ hashFiles('**/go.sum') }}
49-
5046
- name: Build for ACI e2e tests
5147
run: make -f builder.Makefile cli
5248

.github/workflows/ci.yml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ jobs:
1414
name: Lint
1515
runs-on: ubuntu-latest
1616
steps:
17+
- name: Checkout code into the Go module directory
18+
uses: actions/checkout@v3
19+
1720
- name: Set up Go
1821
uses: actions/setup-go@v3
1922
with:
2023
go-version: ${{ env.GO_VERSION }}
21-
22-
- name: Checkout code into the Go module directory
23-
uses: actions/checkout@v2
24+
cache: true
2425

2526
- name: Validate go-mod is up-to-date and license headers
2627
run: make validate
@@ -38,18 +39,14 @@ jobs:
3839
runs-on: ubuntu-latest
3940
if: github.ref == 'refs/heads/main'
4041
steps:
42+
- name: Checkout code into the Go module directory
43+
uses: actions/checkout@v3
44+
4145
- name: Set up Go
4246
uses: actions/setup-go@v3
4347
with:
4448
go-version: ${{ env.GO_VERSION }}
45-
46-
- name: Checkout code into the Go module directory
47-
uses: actions/checkout@v2
48-
49-
- uses: actions/cache@v2
50-
with:
51-
path: ~/go/pkg/mod
52-
key: go-${{ hashFiles('**/go.sum') }}
49+
cache: true
5350

5451
# Ensure we don't discover cross platform build issues at release time.
5552
# Time used to build linux here is gained back in the build for local E2E step
@@ -60,10 +57,14 @@ jobs:
6057
name: Build
6158
runs-on: ubuntu-latest
6259
steps:
60+
- name: Checkout code into the Go module directory
61+
uses: actions/checkout@v3
62+
6363
- name: Set up Go
6464
uses: actions/setup-go@v3
6565
with:
6666
go-version: ${{ env.GO_VERSION }}
67+
cache: true
6768

6869
- name: Set up gosum
6970
run: |
@@ -74,14 +75,6 @@ jobs:
7475
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
7576
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
7677
77-
- name: Checkout code into the Go module directory
78-
uses: actions/checkout@v2
79-
80-
- uses: actions/cache@v2
81-
with:
82-
path: ~/go/pkg/mod
83-
key: go-${{ hashFiles('**/go.sum') }}
84-
8578
- name: Test
8679
env:
8780
BUILD_TAGS: kube

.github/workflows/cli-release.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,20 @@ jobs:
1818
release:
1919
runs-on: ubuntu-latest
2020
steps:
21+
- name: Checkout code into the Go module directory
22+
uses: actions/checkout@v3
23+
2124
- name: Set up Go
2225
uses: actions/setup-go@v3
2326
with:
2427
go-version: ${{ env.GO_VERSION }}
28+
cache: true
2529

2630
- name: Setup docker CLI
2731
run: |
2832
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
2933
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
3034
31-
- name: Checkout code into the Go module directory
32-
uses: actions/checkout@v2
33-
34-
- uses: actions/cache@v2
35-
with:
36-
path: ~/go/pkg/mod
37-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
38-
restore-keys: |
39-
${{ runner.os }}-go-
40-
4135
- name: Build
4236
run: make GIT_TAG=${{ github.event.inputs.tag }} -f builder.Makefile cross
4337

.github/workflows/ecs-tests.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,20 @@ jobs:
2929
needs: check-optional-tests
3030
if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-ecs == 'true'
3131
steps:
32+
- name: Checkout code into the Go module directory
33+
uses: actions/checkout@v3
34+
3235
- name: Set up Go
3336
uses: actions/setup-go@v3
3437
with:
3538
go-version: ${{ env.GO_VERSION }}
39+
cache: true
3640

3741
- name: Setup docker CLI
3842
run: |
3943
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
4044
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
4145
42-
- name: Checkout code into the Go module directory
43-
uses: actions/checkout@v2
44-
45-
- uses: actions/cache@v2
46-
with:
47-
path: ~/go/pkg/mod
48-
key: go-${{ hashFiles('**/go.sum') }}
49-
5046
- name: Build for ECS e2e tests
5147
run: make -f builder.Makefile cli
5248

.github/workflows/kube-tests.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@ jobs:
2929
needs: check-optional-tests
3030
if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-kube == 'true'
3131
steps:
32+
- name: Checkout code into the Go module directory
33+
uses: actions/checkout@v3
34+
3235
- name: Set up Go
3336
uses: actions/setup-go@v3
3437
with:
3538
go-version: ${{ env.GO_VERSION }}
39+
cache: true
3640

3741
- name: Setup docker CLI
3842
run: |
@@ -45,14 +49,6 @@ jobs:
4549
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.10.0/kind-linux-amd64 && chmod +x ./kind && sudo mv ./kind /usr/bin/ && kind version
4650
curl -LO "https://dl.k8s.io/release/v1.20.2/bin/linux/amd64/kubectl" && sudo mv kubectl /usr/bin/ && kubectl version --client
4751
48-
- name: Checkout code into the Go module directory
49-
uses: actions/checkout@v2
50-
51-
- uses: actions/cache@v2
52-
with:
53-
path: ~/go/pkg/mod
54-
key: go-${{ hashFiles('**/go.sum') }}
55-
5652
- name: Build for Kube e2e tests
5753
env:
5854
BUILD_TAGS: kube

.github/workflows/rebase.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout the latest code
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v3
1313
with:
1414
token: ${{ secrets.GITHUB_TOKEN }}
1515
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo

.github/workflows/windows-ci.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ jobs:
3131
needs: check-optional-tests
3232
if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-windows == 'true'
3333
steps:
34+
- name: Checkout code into the Go module directory
35+
uses: actions/checkout@v3
36+
3437
- name: Set up Go
3538
uses: actions/setup-go@v3
3639
with:
3740
go-version: ${{ env.GO_VERSION }}
41+
cache: true
3842

3943
- name: Setup docker CLI
4044
run: |
@@ -43,14 +47,6 @@ jobs:
4347
mv -Force ./docker.exe "C:\Program Files\Docker\"
4448
docker version
4549
46-
- name: Checkout code into the Go module directory
47-
uses: actions/checkout@v2
48-
49-
- uses: actions/cache@v2
50-
with:
51-
path: ~/go/pkg/mod
52-
key: go-${{ hashFiles('**/go.sum') }}
53-
5450
- name: Test
5551
run: make -f builder.Makefile test
5652

0 commit comments

Comments
 (0)