generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 11
36 lines (30 loc) · 913 Bytes
/
unit-tests.yaml
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
33
34
35
36
name: Unit Tests
on:
workflow_call: {}
push:
branches-ignore:
- gh-pages
jobs:
build-binary-n-test:
name: Build Binary locally and run unit tests
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.19
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: build the binary
run: |
go build -mod vendor -o dist/provider ./cmd/server/main.go
- name: Run Unit Tests
run: |
go test -covermode=count -coverprofile=profile.cov ./...
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
GO111MODULE=off go get github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github