@@ -222,26 +222,18 @@ jobs:
222222 token : ${{ secrets.GITHUB_TOKEN }}
223223 ref : ${{ env.COMMIT }}
224224
225- - uses : actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
226- with :
227- go-version-file : " go.mod"
228- cache : false # do our own caching
229-
230- - name : Restore dependencies
231- id : restore-deps
232- uses : actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
233- with :
234- path : ~/go/pkg/mod
235- key : go-${{ runner.os }}${{ runner.arch }}-${{ hashFiles('go.mod') }}-deps-${{ hashFiles('go.sum') }}
225+ - name : Set up Go
226+ id : prepare-go
227+ uses : ./.github/actions/prepare-go
236228
237229 - run : make pre-build-functional-test-coverage
238230
239231 - name : Save dependencies
240232 uses : actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
241- if : ${{ steps.restore-deps .outputs.cache-hit != 'true' }}
233+ if : ${{ steps.prepare-go .outputs.dependency- cache-hit != 'true' }}
242234 with :
243235 path : ~/go/pkg/mod
244- key : ${{ steps.restore-deps .outputs.cache-primary-key }}
236+ key : ${{ steps.prepare-go .outputs.dependency- cache-primary-key }}
245237
246238 - name : Save build outputs
247239 uses : actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
@@ -261,22 +253,8 @@ jobs:
261253 # buf-breaking tries to compare HEAD against merge base so we need to be able to find it
262254 fetch-depth : 100
263255
264- - uses : actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
265- with :
266- go-version-file : " go.mod"
267- cache : false # do our own caching
268-
269- - name : Restore dependencies
270- uses : actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
271- with :
272- path : ~/go/pkg/mod
273- key : go-${{ runner.os }}${{ runner.arch }}-${{ hashFiles('go.mod') }}-deps-${{ hashFiles('go.sum') }}
274-
275- - name : Restore build outputs
276- uses : actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
277- with :
278- path : ~/.cache/go-build
279- key : go-${{ runner.os }}${{ runner.arch }}-build-${{ env.COMMIT }}
256+ - name : Set up Go
257+ uses : ./.github/actions/prepare-go
280258
281259 - uses : jdx/mise-action@dba19683ed58901619b14f395a24841710cb4925 # v4.1.0
282260 with :
@@ -299,22 +277,8 @@ jobs:
299277 token : ${{ secrets.GITHUB_TOKEN }}
300278 ref : ${{ env.COMMIT }}
301279
302- - uses : actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
303- with :
304- go-version-file : " go.mod"
305- cache : false # do our own caching
306-
307- - name : Restore dependencies
308- uses : actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
309- with :
310- path : ~/go/pkg/mod
311- key : go-${{ runner.os }}${{ runner.arch }}-${{ hashFiles('go.mod') }}-deps-${{ hashFiles('go.sum') }}
312-
313- - name : Restore build outputs
314- uses : actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
315- with :
316- path : ~/.cache/go-build
317- key : go-${{ runner.os }}${{ runner.arch }}-build-${{ env.COMMIT }}
280+ - name : Set up Go
281+ uses : ./.github/actions/prepare-go
318282
319283 - name : Run unit tests
320284 timeout-minutes : 20
@@ -347,22 +311,8 @@ jobs:
347311 compose_file : ${{ env.DOCKER_COMPOSE_FILE }}
348312 services : ${{ env.CONTAINERS }}
349313
350- - uses : actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
351- with :
352- go-version-file : " go.mod"
353- cache : false # do our own caching
354-
355- - name : Restore dependencies
356- uses : actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
357- with :
358- path : ~/go/pkg/mod
359- key : go-${{ runner.os }}${{ runner.arch }}-${{ hashFiles('go.mod') }}-deps-${{ hashFiles('go.sum') }}
360-
361- - name : Restore build outputs
362- uses : actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
363- with :
364- path : ~/.cache/go-build
365- key : go-${{ runner.os }}${{ runner.arch }}-build-${{ env.COMMIT }}
314+ - name : Set up Go
315+ uses : ./.github/actions/prepare-go
366316
367317 - name : Wait for containerized dependencies to be healthy
368318 uses : ./.github/actions/docker-compose-healthy
@@ -419,22 +369,8 @@ jobs:
419369 services : ${{ env.CONTAINERS }}
420370 cache : true
421371
422- - uses : actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
423- with :
424- go-version-file : " go.mod"
425- cache : false # do our own caching
426-
427- - name : Restore dependencies
428- uses : actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
429- with :
430- path : ~/go/pkg/mod
431- key : go-${{ runner.os }}${{ runner.arch }}-${{ hashFiles('go.mod') }}-deps-${{ hashFiles('go.sum') }}
432-
433- - name : Restore build outputs
434- uses : actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
435- with :
436- path : ~/.cache/go-build
437- key : go-${{ runner.os }}${{ runner.arch }}-build-${{ env.COMMIT }}
372+ - name : Set up Go
373+ uses : ./.github/actions/prepare-go
438374
439375 - name : ${{ matrix.display_name == 'smoke' && 'ℹ️ Smoke test' || 'ℹ️ Full test' }}
440376 run : echo "::notice::${{ matrix.display_name == 'smoke' && 'This is a smoke test. Add the test-all-dbs label to run all tests on all DBs.' || needs.test-setup.outputs.full_test_reason }}"
@@ -493,22 +429,8 @@ jobs:
493429 compose_file : ${{ env.DOCKER_COMPOSE_FILE }}
494430 services : postgresql
495431
496- - uses : actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
497- with :
498- go-version-file : " go.mod"
499- cache : false
500-
501- - name : Restore dependencies
502- uses : actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
503- with :
504- path : ~/go/pkg/mod
505- key : go-${{ runner.os }}${{ runner.arch }}-${{ hashFiles('go.mod') }}-deps-${{ hashFiles('go.sum') }}
506-
507- - name : Restore build outputs
508- uses : actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
509- with :
510- path : ~/.cache/go-build
511- key : go-${{ runner.os }}${{ runner.arch }}-build-${{ env.COMMIT }}
432+ - name : Set up Go
433+ uses : ./.github/actions/prepare-go
512434
513435 - name : Install PostgreSQL schema
514436 run : make install-schema-postgresql12
0 commit comments