chore: checkout code first in CI (#2347)
setup-go has built-in functionality for caching and restoring go modules and build outputs. The action defaults to search for the dependency file - go.sum in the repository root, and uses its hash as a part of the cache key. To use the cache, we should first checkout code. Otherwise setup-go can't find go.sum and use/restore cache. Related: https://github.com/actions/setup-go#caching-dependency-files-and-build-outputs Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
1b0105fc6e
commit
99dda4e684
|
|
@ -15,13 +15,13 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: actions/setup-go@v4
|
- uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: '1.20'
|
go-version: '1.20'
|
||||||
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Golangci lint
|
- name: Golangci lint
|
||||||
uses: golangci/golangci-lint-action@v3
|
uses: golangci/golangci-lint-action@v3
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue