Skip to content

Commit

Permalink
add: codecov github action
Browse files Browse the repository at this point in the history
  • Loading branch information
sincerefly committed Jan 17, 2024
1 parent 1d423e5 commit e7a19c6
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci-codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CodeCoverage

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go:
- '1.21'
- '1.20'

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: Build and test
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3

with:
files: ./coverage.txt
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit e7a19c6

Please sign in to comment.