From 99dda4e684772eb2acab257c0b3a1c1398800cae Mon Sep 17 00:00:00 2001 From: Gaius Date: Fri, 12 May 2023 17:13:15 +0800 Subject: [PATCH] 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 --- .github/workflows/lint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 65bdea3b5..8c70a0804 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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: