From 481c61b7a93f1199ee943db57e2d82024f0e643f Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Mon, 15 Jul 2024 17:37:34 -0400 Subject: [PATCH] use go version file --- .github/workflows/ci-golang-sbom.yml | 10 +++++----- .github/workflows/operator-cd.yml | 3 +-- .../workflows/publish-operators-for-e2e-tests.yml | 3 +-- .github/workflows/test-with-coverage.yml | 12 ++++++------ 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci-golang-sbom.yml b/.github/workflows/ci-golang-sbom.yml index 0eed871e..ed795956 100644 --- a/.github/workflows/ci-golang-sbom.yml +++ b/.github/workflows/ci-golang-sbom.yml @@ -14,14 +14,14 @@ jobs: name: GolangCI Lint runs-on: ubuntu-20.04 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 with: diff --git a/.github/workflows/operator-cd.yml b/.github/workflows/operator-cd.yml index 5dc4cc10..21397b2d 100644 --- a/.github/workflows/operator-cd.yml +++ b/.github/workflows/operator-cd.yml @@ -7,7 +7,6 @@ on: - '*.*' env: GOPATH: /tmp/go - GO_VERSION: 1.20.x jobs: binary: @@ -24,7 +23,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod - name: Cache dependencies uses: actions/cache@v4 diff --git a/.github/workflows/publish-operators-for-e2e-tests.yml b/.github/workflows/publish-operators-for-e2e-tests.yml index 8fc0d273..3dfbc7a7 100644 --- a/.github/workflows/publish-operators-for-e2e-tests.yml +++ b/.github/workflows/publish-operators-for-e2e-tests.yml @@ -7,7 +7,6 @@ on: env: GOPATH: /tmp/go - GO_VERSION: 1.20.x jobs: binary: @@ -49,7 +48,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod - name: Cache dependencies uses: actions/cache@v4 diff --git a/.github/workflows/test-with-coverage.yml b/.github/workflows/test-with-coverage.yml index cf73c7df..f25440d6 100644 --- a/.github/workflows/test-with-coverage.yml +++ b/.github/workflows/test-with-coverage.yml @@ -15,18 +15,18 @@ jobs: name: Test with Coverage runs-on: ubuntu-20.04 steps: - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: 1.20.x - - name: Checkout code uses: actions/checkout@v4 with: ref: ${{github.event.pull_request.head.ref}} 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: Test run: | make test-with-coverage