| 1 |
name: coverage |
| 2 |
on: [push, pull_request] |
| 3 |
|
| 4 |
jobs: |
| 5 |
coverage: |
| 6 |
strategy: |
| 7 |
matrix: |
| 8 |
go-version: [^1] |
| 9 |
os: [ubuntu-latest] |
| 10 |
runs-on: ${{ matrix.os }} |
| 11 |
env: |
| 12 |
GO111MODULE: "on" |
| 13 |
steps: |
| 14 |
- name: Checkout code |
| 15 |
uses: actions/checkout@v3 |
| 16 |
|
| 17 |
- name: Install Go |
| 18 |
uses: actions/setup-go@v5 |
| 19 |
with: |
| 20 |
go-version: ${{ matrix.go-version }} |
| 21 |
|
| 22 |
- name: Coverage |
| 23 |
run: go test -race -covermode atomic -coverprofile=profile.cov ./... |
| 24 |
|
| 25 |
- name: Send coverage |
| 26 |
uses: shogo82148/actions-goveralls@v1 |
| 27 |
with: |
| 28 |
path-to-profile: profile.cov |
| 29 |
env: |
| 30 |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} |