From 1368f379abcc32a3f1d45599b5d1ca60049586fa Mon Sep 17 00:00:00 2001 From: David Prodinger Date: Tue, 26 Nov 2024 15:18:20 +0100 Subject: [PATCH] test: use go version from go.mod Also use the correct go version for building the package, and not the version from the system (Ubuntu 24.04) see #146 --- .github/workflows/lint.yaml | 7 +++++-- .github/workflows/package.yaml | 6 +++++- .github/workflows/test.yaml | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index aa71c03..b0260d8 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -8,8 +8,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.22' - - run: go run mage.go lint + go-version-file: 'go.mod' + + - name: Lint + run: go run mage.go lint diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index 3616ef0..88d298e 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -12,9 +12,13 @@ jobs: build: strategy: matrix: - arch: [amd64, arm64] + arch: [ amd64, arm64 ] runs-on: ubuntu-24.04 steps: + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' - name: Print Go version and environment id: vars diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f8ea116..53cb7cd 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,7 +13,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version-file: 'go.mod' - name: setup environment run: |