-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.15 KB
/
test.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
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Tests
on:
workflow_dispatch:
pull_request:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
jobs:
code_cov:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Cache go modules and build
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: Setup token for pulling from private repos
run: |
go env -w GOPRIVATE=github.com/emerishq,github.com/allinbits
git config --global url."https://git:${{ secrets.TENDERBOT_GIT_TOKEN }}@github.com".insteadOf "https://github.com"
- name: Run coverage
run: go test -v -failfast -race -coverprofile=coverage.out -covermode=atomic -count=1 ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: coverage.out