From 86d6b8ef21c8a1d82fb23c4530aa31b07de0a305 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 26 Apr 2024 16:39:51 +0200 Subject: [PATCH] Go: put back go setup --- .github/workflows/go-tests.yml | 47 +++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 75c34f4f5de2..5c9204f8405f 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -16,9 +16,6 @@ on: - .github/actions/** - codeql-workspace.yml -env: - GO_VERSION: '~1.22.0' - permissions: contents: read @@ -31,6 +28,21 @@ jobs: - name: Check out code uses: actions/checkout@v4 + - name: Get go version + shell: bash + run: | + ( + echo -n "GO_VERSION=" + bazel run @rules_go//go -- version | sed 's/go version go\(\S*\) .*/\1/' + ) | tee -a "$GITHUB_ENV" + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + cache: false + id: go + - name: Set up CodeQL CLI uses: ./.github/actions/fetch-codeql @@ -42,24 +54,6 @@ jobs: run: | bazel run //go:create-extractor-pack - - name: Cache compilation cache - id: query-cache - uses: ./.github/actions/cache-query-compilation - with: - key: go-qltest - - - name: Test - run: | - cd go - make test cache="${{ steps.query-cache.outputs.cache-dir }}" - - check-code: - name: Check code - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v4 - - name: Check that all Go code is autoformatted run: | cd go @@ -84,3 +78,14 @@ jobs: with: name: qhelp-markdown path: go/qhelp-out/**/*.md + + - name: Cache compilation cache + id: query-cache + uses: ./.github/actions/cache-query-compilation + with: + key: go-qltest + + - name: Test + run: | + cd go + make test cache="${{ steps.query-cache.outputs.cache-dir }}"