Skip to content

Commit 8fc56d5

Browse files
committed
Upgrade actions/setup-go to v4 in CI workflow
actions/setup-go@v4 release enables Go cache by default. This is a cornercase when caching should not be used when compilation across multiple Linux distributions and should be disabled. Signed-off-by: Austin Vazquez <macedonv@amazon.com>
1 parent db40fde commit 8fc56d5

File tree

1 file changed

+29
-36
lines changed

1 file changed

+29
-36
lines changed

.github/workflows/ci.yml

+29-36
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,6 @@ jobs:
1919
timeout-minutes: 5
2020

2121
steps:
22-
#
23-
# Install Go
24-
#
25-
- name: Install Go
26-
uses: actions/setup-go@v3
27-
with:
28-
go-version: '1.20.x'
29-
30-
- name: Set env
31-
shell: bash
32-
run: |
33-
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
34-
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
35-
3622
#
3723
# Checkout repos
3824
#
@@ -42,6 +28,15 @@ jobs:
4228
path: src/github.com/containerd/cgroups
4329
fetch-depth: 25
4430

31+
#
32+
# Install Go
33+
#
34+
- name: Install Go
35+
uses: actions/setup-go@v4
36+
with:
37+
go-version: '1.20.x'
38+
cache-dependency-path: src/github.com/containerd/cgroups
39+
4540
- name: Project checks
4641
uses: containerd/project-checks@v1.1.0
4742
with:
@@ -58,16 +53,17 @@ jobs:
5853
go-version: [1.19.x, 1.20.x]
5954

6055
steps:
61-
- name: Install Go
62-
uses: actions/setup-go@v3
63-
with:
64-
go-version: ${{ matrix.go }}
65-
6656
- name: Checkout cgroups
6757
uses: actions/checkout@v3
6858
with:
6959
path: src/github.com/containerd/cgroups
7060

61+
- name: Install Go
62+
uses: actions/setup-go@v4
63+
with:
64+
go-version: ${{ matrix.go }}
65+
cache-dependency-path: src/github.com/containerd/cgroups
66+
7167
- name: golangci-lint
7268
uses: golangci/golangci-lint-action@v3
7369
with:
@@ -88,22 +84,18 @@ jobs:
8884

8985
runs-on: ${{ matrix.os }}
9086
steps:
91-
- name: Install Go
92-
uses: actions/setup-go@v3
93-
with:
94-
go-version: ${{ matrix.go }}
95-
96-
- name: Set env
97-
shell: bash
98-
run: |
99-
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
100-
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
101-
10287
- name: Checkout cgroups
10388
uses: actions/checkout@v3
10489
with:
10590
path: src/github.com/containerd/cgroups
10691

92+
- name: Install Go
93+
uses: actions/setup-go@v4
94+
with:
95+
go-version: ${{ matrix.go }}
96+
# Disable Go caching feature when compiling across Linux distributions due to collisions until https://github.com/actions/setup-go/issues/368 is resolved.
97+
cache: false
98+
10799
- name: Run cgroup tests
108100
run: |
109101
$(command -v go) test -exec sudo -v -race -coverprofile=coverage.txt -covermode=atomic ./...
@@ -118,22 +110,23 @@ jobs:
118110
runs-on: ubuntu-22.04
119111

120112
steps:
113+
- name: Checkout cgroups
114+
uses: actions/checkout@v3
115+
with:
116+
path: src/github.com/containerd/cgroups
117+
121118
- name: Install Go
122-
uses: actions/setup-go@v3
119+
uses: actions/setup-go@v4
123120
with:
124121
go-version: '1.19.x'
122+
cache-dependency-path: src/github.com/containerd/cgroups
125123

126124
- name: Set env
127125
shell: bash
128126
run: |
129127
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
130128
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
131129
132-
- name: Checkout cgroups
133-
uses: actions/checkout@v3
134-
with:
135-
path: src/github.com/containerd/cgroups
136-
137130
- name: Install protoc
138131
run: |
139132
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.5/protoc-21.5-linux-x86_64.zip

0 commit comments

Comments
 (0)