From bf97e98ac68c25102e811455cd07a9d6c781d760 Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Wed, 14 Feb 2024 11:56:50 +0000 Subject: [PATCH 1/4] chore: bump go version to 1.21 Now that 1.22 is out we can bump this, it should fix the golangci-lint issues that we're seeing --- pkg/go/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/go/go.mod b/pkg/go/go.mod index ef69010f..f7b53880 100644 --- a/pkg/go/go.mod +++ b/pkg/go/go.mod @@ -1,6 +1,6 @@ module github.com/openfga/language/pkg/go -go 1.20 +go 1.21 require ( github.com/antlr4-go/antlr/v4 v4.13.0 From 9016774dc8b9c697a1c9ef77cfa4ec06445b866d Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Wed, 14 Feb 2024 14:45:40 +0000 Subject: [PATCH 2/4] chore(go): set to minimum go version This is the absolute minimum version of go that can be used, seemingly coming from the openfga/api/proto dependency as it is the verion of go listed there --- pkg/go/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/go/go.mod b/pkg/go/go.mod index f7b53880..14108f48 100644 --- a/pkg/go/go.mod +++ b/pkg/go/go.mod @@ -1,6 +1,6 @@ module github.com/openfga/language/pkg/go -go 1.21 +go 1.21.3 require ( github.com/antlr4-go/antlr/v4 v4.13.0 From 0cba297c64d69c96a76aab055538e999b9148fb2 Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Thu, 15 Feb 2024 10:04:40 +0000 Subject: [PATCH 3/4] chore: separate lint, audit and test in ci, test against multiple go versions --- .github/workflows/main-go.yaml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main-go.yaml b/.github/workflows/main-go.yaml index 27ad1797..b29aca8f 100644 --- a/.github/workflows/main-go.yaml +++ b/.github/workflows/main-go.yaml @@ -24,8 +24,28 @@ permissions: contents: read jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version: '1.22' + cache-dependency-path: './pkg/go/go.sum' + check-latest: true + + - name: Audit dependencies + run: make audit-go + + - name: Lint + run: make lint-go + test: runs-on: ubuntu-latest + strategy: + matrix: + go-version: ['1.21', '1.22'] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: @@ -36,12 +56,12 @@ jobs: - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version-file: './pkg/go/go.mod' + go-version: ${{ matrix.go-version }} cache-dependency-path: './pkg/go/go.sum' check-latest: true - name: Build - run: make all-tests-go + run: make test-go release: runs-on: ubuntu-latest From 33fe6e4c3223e2eae7d614cbfc1dbd3f15b1c778 Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Thu, 15 Feb 2024 15:27:41 +0000 Subject: [PATCH 4/4] chore: set to use 1.22 or newer --- .github/workflows/main-go.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main-go.yaml b/.github/workflows/main-go.yaml index b29aca8f..6f135b58 100644 --- a/.github/workflows/main-go.yaml +++ b/.github/workflows/main-go.yaml @@ -31,7 +31,7 @@ jobs: - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: '1.22' + go-version: '>=1.22' cache-dependency-path: './pkg/go/go.sum' check-latest: true