From cfcfa3dd737fd9fa6334e7620b10120d48aa9a42 Mon Sep 17 00:00:00 2001 From: Nikita Pivkin Date: Wed, 14 Aug 2024 16:31:25 +0600 Subject: [PATCH] ci: pin Go version Signed-off-by: Nikita Pivkin --- .github/workflows/test-bundle.yml | 12 ++++++++++-- .github/workflows/test-go.yaml | 6 +++++- .github/workflows/test-rego.yaml | 6 ++++-- .github/workflows/verify-docs.yaml | 7 +++++-- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-bundle.yml b/.github/workflows/test-bundle.yml index 12a6d2f5..51cbb9a0 100644 --- a/.github/workflows/test-bundle.yml +++ b/.github/workflows/test-bundle.yml @@ -2,18 +2,26 @@ name: test rego bundle on: pull_request: merge_group: + env: - GO_VERSION: "1.21" + GO_VERSION: '1.22' + jobs: opa-tests: name: OPA tests - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + - name: Build bundle run: make bundle + - name: Setup OPA uses: ./.github/actions/setup-opa + - name: Check bundle run: opa inspect bundle.tar.gz diff --git a/.github/workflows/test-go.yaml b/.github/workflows/test-go.yaml index 7e7349c8..22b02d51 100644 --- a/.github/workflows/test-go.yaml +++ b/.github/workflows/test-go.yaml @@ -2,6 +2,10 @@ name: Test Go on: pull_request: merge_group: + +env: + GO_VERSION: '1.22' + jobs: build: name: Test @@ -11,7 +15,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version-file: go.mod + go-version: ${{ env.GO_VERSION }} - name: Run tests run: make test diff --git a/.github/workflows/test-rego.yaml b/.github/workflows/test-rego.yaml index 1d3b1d68..d8b23fbb 100644 --- a/.github/workflows/test-rego.yaml +++ b/.github/workflows/test-rego.yaml @@ -11,8 +11,10 @@ on: - "**/*.md" - "LICENSE" merge_group: + env: - GO_VERSION: "1.21" + GO_VERSION: "1.22" + jobs: opa-tests: name: OPA tests @@ -35,7 +37,7 @@ jobs: - uses: actions/setup-go@v5 with: - go-version-file: go.mod + go-version: ${{ env.GO_VERSION }} - name: Test Rego checks run: make test-rego \ No newline at end of file diff --git a/.github/workflows/verify-docs.yaml b/.github/workflows/verify-docs.yaml index 60465c65..27669bd0 100755 --- a/.github/workflows/verify-docs.yaml +++ b/.github/workflows/verify-docs.yaml @@ -2,6 +2,10 @@ name: Verify Docs on: pull_request: merge_group: + +env: + GO_VERSION: '1.22' + jobs: build: name: Verify Docs @@ -9,10 +13,9 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 with: - go-version-file: go.mod + go-version: ${{ env.GO_VERSION }} - run: | make docs