Skip to content

Commit 0f040aa

Browse files
authored
Merge pull request #51126 from vvoland/51124-28.x
[28.x backport] ci: fix cache for go modules
2 parents 8fa4bd5 + 5b1a039 commit 0f040aa

6 files changed

Lines changed: 31 additions & 59 deletions

File tree

.github/workflows/.test-unit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
uses: actions/setup-go@v5
107107
with:
108108
go-version: ${{ env.GO_VERSION }}
109-
cache-dependency-path: vendor.sum
109+
cache: false
110110
-
111111
name: Download reports
112112
uses: actions/download-artifact@v4

.github/workflows/.test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ jobs:
265265
uses: actions/setup-go@v5
266266
with:
267267
go-version: ${{ env.GO_VERSION }}
268-
cache-dependency-path: vendor.sum
268+
cache: false
269269
-
270270
name: Download reports
271271
uses: actions/download-artifact@v4
@@ -297,7 +297,7 @@ jobs:
297297
uses: actions/setup-go@v5
298298
with:
299299
go-version: ${{ env.GO_VERSION }}
300-
cache-dependency-path: vendor.sum
300+
cache: false
301301
-
302302
name: Install gotestlist
303303
run:
@@ -454,7 +454,7 @@ jobs:
454454
uses: actions/setup-go@v5
455455
with:
456456
go-version: ${{ env.GO_VERSION }}
457-
cache-dependency-path: vendor.sum
457+
cache: false
458458
-
459459
name: Download reports
460460
uses: actions/download-artifact@v4

.github/workflows/.windows.yml

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,6 @@ jobs:
7070
} ElseIf ("${{ inputs.os }}" -eq "windows-2022") {
7171
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
7272
}
73-
-
74-
name: Cache
75-
uses: actions/cache@v4
76-
with:
77-
path: |
78-
~\AppData\Local\go-build
79-
~\go\pkg\mod
80-
${{ github.workspace }}\go-build
81-
${{ env.GOPATH }}\pkg\mod
82-
key: ${{ inputs.os }}-${{ github.job }}-${{ hashFiles('**/vendor.sum') }}
83-
restore-keys: |
84-
${{ inputs.os }}-${{ github.job }}-
8573
-
8674
name: Docker info
8775
run: |
@@ -98,8 +86,6 @@ jobs:
9886
name: Build binaries
9987
run: |
10088
& docker run --name ${{ env.TEST_CTN_NAME }} -e "DOCKER_GITCOMMIT=${{ github.sha }}" `
101-
-v "${{ github.workspace }}\go-build:C:\Users\ContainerAdministrator\AppData\Local\go-build" `
102-
-v "${{ github.workspace }}\go\pkg\mod:C:\gopath\pkg\mod" `
10389
${{ env.TEST_IMAGE_NAME }} hack\make.ps1 -Daemon -Client
10490
-
10591
name: Copy artifacts
@@ -149,18 +135,6 @@ jobs:
149135
} ElseIf ("${{ inputs.os }}" -eq "windows-2022") {
150136
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
151137
}
152-
-
153-
name: Cache
154-
uses: actions/cache@v4
155-
with:
156-
path: |
157-
~\AppData\Local\go-build
158-
~\go\pkg\mod
159-
${{ github.workspace }}\go-build
160-
${{ env.GOPATH }}\pkg\mod
161-
key: ${{ inputs.os }}-${{ github.job }}-${{ hashFiles('**/vendor.sum') }}
162-
restore-keys: |
163-
${{ inputs.os }}-${{ github.job }}-
164138
-
165139
name: Docker info
166140
run: |
@@ -177,8 +151,6 @@ jobs:
177151
name: Test
178152
run: |
179153
& docker run --name ${{ env.TEST_CTN_NAME }} -e "DOCKER_GITCOMMIT=${{ github.sha }}" `
180-
-v "${{ github.workspace }}\go-build:C:\Users\ContainerAdministrator\AppData\Local\go-build" `
181-
-v "${{ github.workspace }}\go\pkg\mod:C:\gopath\pkg\mod" `
182154
-v "${{ env.GOPATH }}\src\github.com\docker\docker\bundles:C:\gopath\src\github.com\docker\docker\bundles" `
183155
${{ env.TEST_IMAGE_NAME }} hack\make.ps1 -TestUnit
184156
-
@@ -212,7 +184,7 @@ jobs:
212184
uses: actions/setup-go@v5
213185
with:
214186
go-version: ${{ env.GO_VERSION }}
215-
cache-dependency-path: vendor.sum
187+
cache: false
216188
-
217189
name: Download artifacts
218190
uses: actions/download-artifact@v4
@@ -242,7 +214,7 @@ jobs:
242214
uses: actions/setup-go@v5
243215
with:
244216
go-version: ${{ env.GO_VERSION }}
245-
cache-dependency-path: vendor.sum
217+
cache: false
246218
-
247219
name: Install gotestlist
248220
run:
@@ -295,6 +267,12 @@ jobs:
295267
uses: actions/checkout@v4
296268
with:
297269
path: ${{ env.GOPATH }}/src/github.com/docker/docker
270+
-
271+
name: Set up Go
272+
uses: actions/setup-go@v5
273+
with:
274+
go-version: ${{ env.GO_VERSION }}
275+
cache: false
298276
-
299277
name: Set up Jaeger
300278
run: |
@@ -426,12 +404,6 @@ jobs:
426404
& "${{ env.BIN_OUT }}\docker" images
427405
env:
428406
DOCKER_HOST: npipe:////./pipe/docker_engine
429-
-
430-
name: Set up Go
431-
uses: actions/setup-go@v5
432-
with:
433-
go-version: ${{ env.GO_VERSION }}
434-
cache-dependency-path: vendor.sum
435407
-
436408
name: Test integration
437409
if: matrix.test == './...'
@@ -525,7 +497,7 @@ jobs:
525497
uses: actions/setup-go@v5
526498
with:
527499
go-version: ${{ env.GO_VERSION }}
528-
cache-dependency-path: vendor.sum
500+
cache: false
529501
-
530502
name: Download reports
531503
uses: actions/download-artifact@v4

.github/workflows/arm64.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ jobs:
165165
uses: actions/setup-go@v5
166166
with:
167167
go-version: ${{ env.GO_VERSION }}
168-
cache-dependency-path: vendor.sum
168+
cache: false
169169
-
170170
name: Download reports
171171
uses: actions/download-artifact@v4
@@ -268,7 +268,7 @@ jobs:
268268
uses: actions/setup-go@v5
269269
with:
270270
go-version: ${{ env.GO_VERSION }}
271-
cache-dependency-path: vendor.sum
271+
cache: false
272272
-
273273
name: Download reports
274274
uses: actions/download-artifact@v4

.github/workflows/buildkit.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
uses: actions/setup-go@v5
109109
with:
110110
go-version: ${{ env.GO_VERSION }}
111-
cache-dependency-path: vendor.sum
111+
cache: false
112112
-
113113
name: BuildKit ref
114114
run: |
@@ -191,6 +191,7 @@ jobs:
191191
- name: Env
192192
run: |
193193
Get-ChildItem Env: | Out-String
194+
194195
- name: Moby - Init
195196
run: |
196197
New-Item -ItemType "directory" -Path "${{ github.workspace }}\go-build"
@@ -201,18 +202,7 @@ jobs:
201202
uses: actions/setup-go@v5
202203
with:
203204
go-version: ${{ env.GO_VERSION }}
204-
cache-dependency-path: vendor.sum
205-
- name: Cache
206-
uses: actions/cache@v4
207-
with:
208-
path: |
209-
~\AppData\Local\go-build
210-
~\go\pkg\mod
211-
${{ github.workspace }}\go-build
212-
${{ env.GOPATH }}\pkg\mod
213-
key: ${{ inputs.os }}-${{ github.job }}-${{ hashFiles('**/vendor.sum') }}
214-
restore-keys: |
215-
${{ inputs.os }}-${{ github.job }}-
205+
cache: false
216206

217207
- name: Docker info
218208
run: |
@@ -312,22 +302,27 @@ jobs:
312302
disabledFeatures="${disabledFeatures},merge_diff"
313303
fi
314304
echo "BUILDKIT_TEST_DISABLE_FEATURES=${disabledFeatures}" >> $GITHUB_ENV
305+
315306
- name: Expose GitHub Runtime
316307
uses: crazy-max/ghaction-github-runtime@v3
308+
317309
- name: Checkout
318310
uses: actions/checkout@v4
319311
with:
320312
path: moby
313+
321314
- name: Set up Go
322315
uses: actions/setup-go@v5
323316
with:
324317
go-version: ${{ env.GO_VERSION }}
325-
cache-dependency-path: vendor.sum
318+
cache: false
319+
326320
- name: BuildKit ref
327321
shell: bash
328322
run: |
329323
echo "$(./hack/buildkit-ref)" >> $GITHUB_ENV
330324
working-directory: moby
325+
331326
- name: Checkout BuildKit ${{ env.BUILDKIT_REF }}
332327
uses: actions/checkout@v4
333328
with:
@@ -362,6 +357,7 @@ jobs:
362357
testFlags="${testFlags} --run=TestIntegration/$testSliceOffset.*/worker=${{ matrix.worker }}"
363358
fi
364359
echo "TESTFLAGS=${testFlags}" >> $GITHUB_ENV
360+
365361
- name: Test
366362
shell: bash
367363
run: |

.github/workflows/codeql.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ on:
3232
# * * * * *
3333
- cron: '0 9 * * 4'
3434

35+
env:
36+
GO_VERSION: "1.24.7"
37+
3538
jobs:
3639
codeql:
3740
runs-on: ubuntu-24.04
@@ -55,10 +58,11 @@ jobs:
5558
run: |
5659
ln -s vendor.mod go.mod
5760
ln -s vendor.sum go.sum
58-
- name: Update Go
61+
- name: Set up Go
5962
uses: actions/setup-go@v5
6063
with:
61-
go-version: "1.24.7"
64+
go-version: ${{ env.GO_VERSION }}
65+
cache: false
6266
- name: Initialize CodeQL
6367
uses: github/codeql-action/init@v3
6468
with:

0 commit comments

Comments
 (0)