Skip to content

add readme job -fix2 #12

add readme job -fix2

add readme job -fix2 #12

Workflow file for this run

name: Coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Go Cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download
- name: Run tests and generate coverage
run: |
go test -v -race -coverprofile=coverage.txt -covermode=atomic $(go list ./... | grep -v /example)
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.txt
flags: unittests
- name: Install goveralls
run: go install github.com/mattn/goveralls@latest
- name: Send coverage to Coveralls
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: goveralls -coverprofile=coverage.txt -service=github