-
Notifications
You must be signed in to change notification settings - Fork 6
35 lines (34 loc) · 1007 Bytes
/
run-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
name: Run Tests
on:
push:
tags:
- v*
branches:
- main
pull_request:
jobs:
build:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: actions/checkout@v3
# Install gotestfmt on the VM running the action.
- name: Set up gotestfmt
uses: haveyoudebuggedit/gotestfmt-action@v2
with:
# Optional: pass GITHUB_TOKEN to avoid rate limiting.
token: ${{ secrets.GITHUB_TOKEN }}
# Run tests with nice formatting. Save the original log in /tmp/gotest.log
- name: Run tests
run: make test-and-cover 2>&1 | tee /tmp/gotest.log | grep '"Time"' | gotestfmt
- name: Install goveralls
env:
GO111MODULE: "off"
run: go get github.com/mattn/goveralls
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=profile.cov -service=github