From 7359ec0a790ce33175e9c02c071ce20172322df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Thu, 1 Aug 2024 17:02:11 +0200 Subject: [PATCH] chore: fix checkout and setup-go ordering to optimize cache usage --- .github/workflows/pull-request.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 0b0c34b..f609bf6 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -11,14 +11,15 @@ jobs: platform: [ubuntu-latest] runs-on: ${{ matrix.platform }} steps: - - name: Install Go - uses: actions/setup-go@v1 - with: - go-version: ${{ matrix.go-version }} + # Checkout should always be before setup-go to ensure caching is working - name: checkout uses: actions/checkout@v3 with: fetch-depth: 1 + - name: Install Go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go-version }} - name: Run unit tests run: make test build-test: @@ -29,13 +30,14 @@ jobs: arch: [386, amd64, arm, arm64] runs-on: ${{ matrix.platform }} steps: - - name: Install Go - uses: actions/setup-go@v1 - with: - go-version: ${{ matrix.go-version }} + # Checkout should always be before setup-go to ensure caching is working - name: checkout uses: actions/checkout@v2 with: fetch-depth: 1 + - name: Install Go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go-version }} - name: Building binary run: GOARCH=${{ matrix.arch }} make compile