From 52be4525d54079ed9ed2754c9484c97ee497f647 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Tue, 24 Dec 2024 00:31:37 +0100 Subject: [PATCH] Checkout before installing go Obtaining the code before deploying go allows better caching, as the go.sum file becomes available. See https://github.com/actions/setup-go/issues/281 --- .github/workflows/build_binaries.yml | 4 ++-- .github/workflows/codeql-analysis.yml | 6 +++--- .github/workflows/tests.yml | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_binaries.yml b/.github/workflows/build_binaries.yml index 7de6e733d0c..62ff3a4ebf2 100644 --- a/.github/workflows/build_binaries.yml +++ b/.github/workflows/build_binaries.yml @@ -9,13 +9,13 @@ jobs: name: Build runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v4 - name: Set up Golang uses: actions/setup-go@v5 with: go-version: "1.23.x" check-latest: true - - name: Checkout - uses: actions/checkout@v4 - name: Compile binaries env: CGO_ENABLED: 0 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b2eb4d95fa1..adb8243958e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -24,13 +24,13 @@ jobs: fail-fast: false steps: - - name: Checkout repository - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 with: go-version: "1.23.x" + - name: Checkout repository + uses: actions/checkout@v4 + - name: Initialize CodeQL uses: github/codeql-action/init@v3 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a471ad7a297..1d4af838123 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,18 +17,18 @@ jobs: os: [ubuntu-latest, windows-latest, macOS-latest] go-version: ["1.23.x"] steps: + - name: Checkout + uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - - name: Checkout - uses: actions/checkout@v4 - name: Run unit tests with coverage and race conditions checking if: matrix.os == 'ubuntu-latest' run: make test - name: Run unit tests without coverage and race conditions checking if: matrix.os != 'ubuntu-latest' - run: go test -count=1 ./... + run: go test ./... integration-tests: name: Integration Tests @@ -44,12 +44,12 @@ jobs: - 5432:5432 options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: + - name: Checkout + uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 with: go-version: "1.23.x" - - name: Checkout - uses: actions/checkout@v4 - name: Install Postgres client run: sudo apt update && sudo apt install -y postgresql-client - name: Run integration tests