From 6ff6958c7620faf56238acfa6a26baca2a642947 Mon Sep 17 00:00:00 2001 From: Jordan Barrett Date: Wed, 2 Aug 2023 10:36:59 +0800 Subject: [PATCH 1/2] Run unit tests only on Go 1.20 --- .github/workflows/tests.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3b47e444..736bd1d4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,10 +12,8 @@ jobs: strategy: fail-fast: false - matrix: - go: ['1.20', '1.19', '1.18', '1.17'] - name: Go ${{ matrix.go }} + name: Go unit tests steps: - uses: actions/checkout@v3 @@ -23,7 +21,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: ${{ matrix.go }} + go-version-file: 'go.mod' - name: Test and build run: | From 14df9a7adc2e27a1b7fb4d1bbbadd2e8018fd40c Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Wed, 2 Aug 2023 09:38:25 +0100 Subject: [PATCH 2/2] ci: run unit tests on go 1.20 only; build using version from go.mod --- .github/workflows/binaries.yml | 2 +- .github/workflows/tests.yml | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index 9cdb4fb0..bde1060d 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -27,7 +27,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: stable # latest stable version of Go + go-version-file: "go.mod" - name: Build binary and create archive id: build diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 736bd1d4..e5fb73a5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,16 +12,17 @@ jobs: strategy: fail-fast: false + matrix: + go: ['1.20'] - name: Go unit tests - + name: Go ${{ matrix.go }} steps: - uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: - go-version-file: 'go.mod' + go-version: ${{ matrix.go }} - name: Test and build run: | @@ -32,14 +33,13 @@ jobs: runs-on: ubuntu-latest name: Root Tests - steps: - uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: - go-version-file: 'go.mod' + go-version: ${{ matrix.go }} - name: Test run: | @@ -55,12 +55,11 @@ jobs: runs-on: ubuntu-latest name: Format check - steps: - uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version-file: 'go.mod'