Skip to content

Commit

Permalink
feat(ci): use codecove instead of coverall for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Sep 16, 2024
1 parent 9298b53 commit ef35ba7
Showing 1 changed file with 17 additions and 24 deletions.
41 changes: 17 additions & 24 deletions .github/workflows/coverage.yml
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 }}

0 comments on commit ef35ba7

Please sign in to comment.