From be7920ee21163661f14cae4ab8bdcdf88945b686 Mon Sep 17 00:00:00 2001 From: Ignasi Fosch Date: Sun, 8 Oct 2023 08:14:22 +0200 Subject: [PATCH] Normalize go version This makes the test workflow use a normalized Go version, so updating this should be easier. --- .github/workflows/push.yaml | 5 ++++- .github/workflows/release.yaml | 5 ++++- .github/workflows/test.yaml | 17 ++++++++++------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 460f366..00c349e 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -3,6 +3,9 @@ on: branches: - master +env: + GO_VERSION: '^1.16' + jobs: test: runs-on: ubuntu-latest @@ -11,7 +14,7 @@ jobs: name: Install Go uses: actions/setup-go@v2 with: - go-version: '^1.16' + go-version: ${{ env.GO_VERSION }} - name: Prepare coverage run: | diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a2747dc..4e28c1e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,6 +3,9 @@ on: tags: - '*' +env: + GO_VERSION: '^1.16' + jobs: docker: runs-on: ubuntu-latest @@ -11,7 +14,7 @@ jobs: name: Install Go uses: actions/setup-go@v2 with: - go-version: '^1.16' + go-version: ${{ env.GO_VERSION }} - name: Get tag name id: tag_name diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 46792e0..7af8b85 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,5 +1,8 @@ on: [pull_request] +env: + GO_VERSION: '^1.16' + jobs: test: runs-on: ubuntu-latest @@ -8,7 +11,7 @@ jobs: name: Install Go uses: actions/setup-go@v2 with: - go-version: '^1.16' + go-version: ${{ env.GO_VERSION }} - name: Prepare coverage run: | @@ -58,7 +61,7 @@ jobs: name: Install Go uses: actions/setup-go@v2 with: - go-version: '^1.16' + go-version: ${{ env.GO_VERSION }} - name: Check code smells run: | @@ -70,7 +73,7 @@ jobs: name: Install Go uses: actions/setup-go@v2 with: - go-version: '^1.16' + go-version: ${{ env.GO_VERSION }} - name: Install gocyclo run: | @@ -89,7 +92,7 @@ jobs: name: Install Go uses: actions/setup-go@v2 with: - go-version: '^1.16' + go-version: ${{ env.GO_VERSION }} - name: Install golint run: | @@ -108,7 +111,7 @@ jobs: name: Install Go uses: actions/setup-go@v2 with: - go-version: '^1.16' + go-version: ${{ env.GO_VERSION }} - name: Install ineffassign run: | @@ -131,7 +134,7 @@ jobs: name: Install Go uses: actions/setup-go@v2 with: - go-version: '^1.16' + go-version: ${{ env.GO_VERSION }} - name: Install spellchecker run: | @@ -150,7 +153,7 @@ jobs: name: Install Go uses: actions/setup-go@v2 with: - go-version: '^1.16' + go-version: ${{ env.GO_VERSION }} - name: Install staticcheck run: |