Skip to content

Commit

Permalink
ci: add Codecov to check test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
phm07 committed Nov 14, 2023
1 parent 1143e07 commit b3a45aa
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Codecov CI

on:
push:
branches: [main]
pull_request:

jobs:
codecov:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"

- name: Generate coverage report ./...
run: go test -coverprofile=coverage.txt

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/bats
/cmd/hcloud/hcloud
hcloud_cli.p12
coverage.txt

0 comments on commit b3a45aa

Please sign in to comment.