From 5758a6497a95f8d4a066a99b3c7455bc2064f89e Mon Sep 17 00:00:00 2001 From: Kanika Rana <46766610+ranakan19@users.noreply.github.com> Date: Mon, 22 Jul 2024 15:32:08 -0400 Subject: [PATCH] SANDBOX-677 use go-version-file (#49) * use go version file instead * remove go version env var --------- Co-authored-by: Matous Jobanek --- .github/workflows/linters.yml | 8 ++++---- .github/workflows/test-with-coverage.yml | 10 +++++----- .github/workflows/user-identity-mapper.yml | 11 +++++------ 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index c826063..c3a7b87 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -15,13 +15,13 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Go uses: actions/setup-go@v5 with: - go-version: 1.20.x - - - name: Checkout code - uses: actions/checkout@v4 + go-version-file: go.mod - name: Lint uses: golangci/golangci-lint-action@v6 diff --git a/.github/workflows/test-with-coverage.yml b/.github/workflows/test-with-coverage.yml index b23d103..9eed978 100644 --- a/.github/workflows/test-with-coverage.yml +++ b/.github/workflows/test-with-coverage.yml @@ -19,11 +19,6 @@ jobs: name: Test with coverage steps: - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: 1.20.x - - name: Checkout code uses: actions/checkout@v4 with: @@ -31,6 +26,11 @@ jobs: repository: ${{github.event.pull_request.head.repo.full_name}} fetch-depth: 0 + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + - name: Cache dependencies uses: actions/cache@v4 with: diff --git a/.github/workflows/user-identity-mapper.yml b/.github/workflows/user-identity-mapper.yml index 544405b..6cae891 100644 --- a/.github/workflows/user-identity-mapper.yml +++ b/.github/workflows/user-identity-mapper.yml @@ -8,7 +8,6 @@ on: env: GOPATH: /tmp/go - GO_VERSION: 1.20.x IMAGE_REGISTRY: quay.io REGISTRY_USER: "codeready-toolchain+push" REGISTRY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} @@ -19,16 +18,16 @@ jobs: runs-on: ubuntu-latest steps: - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GO_VERSION }} - - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + - name: Cache dependencies uses: actions/cache@v4 with: