-
Notifications
You must be signed in to change notification settings - Fork 11
32 lines (30 loc) · 917 Bytes
/
main.yml
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
32
name: CI
on: [push]
jobs:
Test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test
run: go test -v ./... -coverprofile=coverage.out -covermode=atomic -bench=./...
- name: Install Goveralls # this step must come after running the tests, to prevent dependency version conflicts
run: |
go get github.com/mattn/goveralls
- name: Send Code Coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.out