From 2debe08a0f0e535234491628baffd0e342f0e9ef Mon Sep 17 00:00:00 2001 From: gongna1 Date: Wed, 25 Sep 2024 19:26:45 +0800 Subject: [PATCH] feat:change codecov.yml --- .github/workflows/codecov.yml | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 2f58dcd..3d3228d 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,35 +1,27 @@ -name: Example workflow for Codecov +name: Go -on: [push] +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] jobs: - run: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - env: - OS: ${{ matrix.os }} - GO_VERSION: '1.16' # 选择你需要的 Go 版本 + code_cov: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - + - name: Set up Go uses: actions/setup-go@v4 with: - go-version: ${{ env.GO_VERSION }} - + go-version: '1.16' + - name: Run tests and generate coverage report run: | go test -coverprofile=coverage.out -gcflags="all=-l -N" $(go list ./...) -short - + - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: file: coverage.out - env_vars: OS,GO_VERSION - fail_ci_if_error: true - flags: unittests - name: codecov-umbrella - token: ${{ secrets.CODECOV_TOKEN }} - verbose: true