-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): use codecove instead of coverall for coverage
- Loading branch information
1 parent
9298b53
commit ef35ba7
Showing
1 changed file
with
17 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,25 @@ | ||
name: coverage | ||
on: [push, pull_request] | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
|
||
jobs: | ||
coverage: | ||
strategy: | ||
matrix: | ||
go-version: [^1] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
GO111MODULE: "on" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/checkout@v4 | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- run: | | ||
git config --global url."https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/charmbracelet".insteadOf "https://github.com/charmbracelet" | ||
git config --global url."https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/charmcli".insteadOf "https://github.com/charmcli" | ||
- name: Coverage | ||
env: | ||
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
go test -race -covermode atomic -coverprofile=profile.cov ./... | ||
go install github.com/mattn/goveralls@latest | ||
goveralls -coverprofile=profile.cov -service=github | ||
go-version: "stable" | ||
- name: Gather dependencies | ||
run: go mod download | ||
- name: Run coverage | ||
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_ORG_TOKEN }} |