From f7d02cdedbde73eecf966c9e7ff1c127e9eccb56 Mon Sep 17 00:00:00 2001 From: Li Jie Date: Mon, 4 Nov 2024 08:34:28 +0800 Subject: [PATCH] ci: test go 1.20 ... 1.23 --- .github/workflows/go.yml | 45 ++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a4a4c66..12c912a 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -29,8 +29,8 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.20' - + go-version: '1.23' + - name: Check formatting run: | if [ -n "$(go fmt ./...)" ]; then @@ -44,27 +44,32 @@ jobs: os: - macos-latest - ubuntu-24.04 + go: + - '1.20' + - '1.21' + - '1.22' + - '1.23' runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.23' + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{matrix.go}} - - name: Build - run: go build -v ./... + - name: Build + run: go build -v ./... - - name: Test with coverage - run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... + - name: Test with coverage + run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... - - name: Upload coverage to Codecov - if: matrix.os == 'ubuntu-24.04' - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.txt - flags: unittests - name: codecov-umbrella - fail_ci_if_error: true + - name: Upload coverage to Codecov + if: matrix.os == 'ubuntu-24.04' + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.txt + flags: unittests + name: codecov-umbrella + fail_ci_if_error: true