-
Notifications
You must be signed in to change notification settings - Fork 3
31 lines (30 loc) · 838 Bytes
/
test.yaml
File metadata and controls
31 lines (30 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Test & Coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
# a single job to run tests and coverage for a Golang project; report coverage to Coveralls
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Install dependencies
run: go mod download
- name: Run tests
run: go test -v -vet=all -coverprofile=profile.cov ./...
- name: Install goveralls
run: go install github.com/mattn/goveralls@latest
- name: Report coverage to Coveralls
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=profile.cov -service=github