From 2d8335fc3e5265eaca04a19ad31528c973a2e916 Mon Sep 17 00:00:00 2001 From: yuanbohan Date: Thu, 1 Feb 2024 09:59:53 +0800 Subject: [PATCH] code coverage --- .github/workflows/ci.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec0e635..2c9e2e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,9 @@ name: ci -on: +on: pull_request: types: [opened, synchronize, reopened, ready_for_review] - + push: branches: - "main" @@ -15,15 +15,17 @@ jobs: ci: if: github.event.pull_request.draft == false runs-on: ubuntu-latest + strategy: + matrix: + go-version: ["1.19.x", "1.20.x", "1.21.x"] steps: - name: Checkout Repository uses: actions/checkout@v3 - - name: Set up Go + - name: Set up Go ${{ matrix.go-version }} uses: actions/setup-go@v3 with: - go-version: '1.19.x' - # go-version-file: './go.mod' + go-version: ${{ matrix.go-version }} cache: true - name: Build @@ -32,5 +34,7 @@ jobs: - name: Test run: go test -v ./... -race -covermode=atomic -coverprofile=coverage.out - - name: Upload coverage to Codecov + - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}