-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (52 loc) · 1.56 KB
/
test.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Trigger test suite
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: Test the livepeer-box project
runs-on: [self-hosted, linux, amd64]
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
# Check https://github.com/livepeer/go-livepeer/pull/1891
# for ref value discussion
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up go
id: go
uses: actions/setup-go@v3
with:
go-version: 1.17
- name: Cache go modules
id: cache-go-mod
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install go modules
if: steps.cache-go-mod.outputs.cache-hit != 'true'
run: go mod download
- name: go fmt
run: |
go fmt ./...
git diff --exit-code
# - name: Run Revive Action by building from repository
# uses: morphy2k/revive-action@v2
# with:
# config: config.toml
- name: misspell
uses: reviewdog/action-misspell@v1
- name: Run tests with coverage
run: go test ./... -race -covermode=atomic -coverprofile=coverage.out
- name: Upload coverage reports
uses: codecov/codecov-action@v4
with:
files: ./coverage.out
name: ${{ github.event.repository.name }}
token: ${{ secrets.CI_CODECOV_TOKEN }}