From 1d8baa5e58116a7a6533a91b6c019496ebee974e Mon Sep 17 00:00:00 2001 From: Nikolay Eskov Date: Sat, 14 Dec 2024 22:43:46 +0300 Subject: [PATCH] CI: set up go after code checkout. (#1564) --- .github/workflows/go.yml | 18 ++++++++++-------- .github/workflows/itests.yml | 6 +++--- .github/workflows/itests_race.yml | 6 +++--- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index bd85a4bcd..795154421 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -28,12 +28,14 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Set up Go 1.22 uses: actions/setup-go@v5.2.0 with: go-version: 1.22.x check-latest: true cache: false # don't save & restore build caches because golangci-lint action does it internally + - name: Get dependencies run: go mod vendor - name: golangci-lint-soft @@ -51,6 +53,11 @@ jobs: if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'wavesplatform/gowaves' steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go 1.22 uses: actions/setup-go@v5.2.0 with: @@ -61,11 +68,6 @@ jobs: - name: Set up GolangCI-Lint run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $HOME/bin v1.61.0 - - name: Check out code into the Go module directory - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Get dependencies run: go mod vendor @@ -88,6 +90,9 @@ jobs: github.repository == 'wavesplatform/gowaves'}} steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + - name: Set up Go 1.22 uses: actions/setup-go@v5.2.0 with: @@ -96,9 +101,6 @@ jobs: cache: true id: go - - name: Check out code into the Go module directory - uses: actions/checkout@v4 - - name: Get dependencies run: go mod vendor diff --git a/.github/workflows/itests.yml b/.github/workflows/itests.yml index a47dd8212..9438e12a1 100644 --- a/.github/workflows/itests.yml +++ b/.github/workflows/itests.yml @@ -18,6 +18,9 @@ jobs: if: (github.event_name == 'workflow_dispatch' || github.event.review.state == 'APPROVED') && github.repository == 'wavesplatform/gowaves' steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + - name: Set up Go 1.22 uses: actions/setup-go@v5.2.0 with: @@ -26,9 +29,6 @@ jobs: cache: true id: go - - name: Check out code into the Go module directory - uses: actions/checkout@v4 - - name: Get dependencies run: go mod vendor diff --git a/.github/workflows/itests_race.yml b/.github/workflows/itests_race.yml index a1c08a9d9..f72cc05ca 100644 --- a/.github/workflows/itests_race.yml +++ b/.github/workflows/itests_race.yml @@ -11,6 +11,9 @@ jobs: if: github.repository == 'wavesplatform/gowaves' steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + - name: Set up Go 1.22 uses: actions/setup-go@v5.2.0 with: @@ -19,9 +22,6 @@ jobs: cache: true id: go - - name: Check out code into the Go module directory - uses: actions/checkout@v4 - - name: Get dependencies run: go mod vendor