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:
Gaius 2023-05-12 17:13:15 +08:00
parent 1b0105fc6e
commit 99dda4e684
No known key found for this signature in database
GPG Key ID: 8B4E5D1290FA2FFB
1 changed files with 3 additions and 3 deletions

View File

@ -15,13 +15,13 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Checkout code
uses: actions/checkout@v3
- name: Golangci lint
uses: golangci/golangci-lint-action@v3
with: