Skip to content

Commit

Permalink
feat:change codecov.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gongna-au committed Sep 25, 2024
1 parent 6df3c99 commit 2debe08
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2debe08

Please sign in to comment.