Skip to content

Commit

Permalink
feat:add codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
gongna-au committed Sep 25, 2024
1 parent 2debe08 commit d3cac01
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: Go
name: Run tests and upload coverage

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
on:
push

jobs:
code_cov:
test:
name: Run tests and collect coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.16'

- name: Run tests and generate coverage report
run: |
go test -coverprofile=coverage.out -gcflags="all=-l -N" $(go list ./...) -short
go-version: '1.16'

- name: Run tests
run: go test $(go list ./...) -coverprofile=coverage.txt

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
file: coverage.out
token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit d3cac01

Please sign in to comment.