From 7548dfeb368887b6ed677b412ee7b70eb00725cf Mon Sep 17 00:00:00 2001 From: Alexey Makhov Date: Fri, 13 Oct 2023 15:11:22 +0300 Subject: [PATCH] Get go version from the go.mod on pipelines Signed-off-by: Alexey Makhov --- .github/workflows/go.yml | 17 +++++++---------- .github/workflows/publish-docs.yml | 4 ++-- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 61b58c36d..639765bc9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -24,9 +24,6 @@ on: - LICENSE - '**.svg' -env: - GO_VERSION: "1.21.1" - jobs: build: name: Build @@ -41,7 +38,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod - name: Build run: | @@ -77,13 +74,13 @@ jobs: runs-on: ubuntu-latest steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + - name: Set up Go uses: actions/setup-go@v4 with: - go-version: ${{ env.GO_VERSION }} - - - name: Check out code into the Go module directory - uses: actions/checkout@v4 + go-version-file: go.mod - name: Run unit tests run: | @@ -111,7 +108,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod - name: Create image bundle run: | @@ -145,7 +142,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod - name: Create image bundle run: | diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 80f4089f5..0f06892f9 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -24,10 +24,10 @@ jobs: cache: pip cache-dependency-path: docs/requirements.txt - - name: Set up Go ${{ env.GO_VERSION }} + - name: Set up Go uses: actions/setup-go@v4 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod - name: Install dependencies run: |