Skip to content

Commit 5bd1d8f

Browse files
committed
build: Ensure checkout is the first operation
The setup-go step can be sped up by caching Go dependencies. The input for that operation is the go.sum file. Previously, the checkout operation was happening after the setup-go, which meant that go.sum was never available which effectively meant the cache was disabled. Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
1 parent b2c1982 commit 5bd1d8f

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/git.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ jobs:
1616
GIT_DIST_PATH: .git-dist/${{ matrix.git[0] }}
1717

1818
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
1922
- name: Install Go
2023
uses: actions/setup-go@v4
2124
with:
2225
go-version: 1.21.x
2326

24-
- name: Checkout code
25-
uses: actions/checkout@v4
26-
2727
- name: Install build dependencies
2828
run: sudo apt-get update && sudo apt-get install gettext libcurl4-openssl-dev
2929

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313

1414
runs-on: ${{ matrix.platform }}
1515
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
1619
- name: Install Go
1720
uses: actions/setup-go@v4
1821
with:
1922
go-version: ${{ matrix.go-version }}
20-
21-
- name: Checkout code
22-
uses: actions/checkout@v4
2323

2424
- name: Configure known hosts
2525
if: matrix.platform != 'ubuntu-latest'

0 commit comments

Comments
 (0)