-
Notifications
You must be signed in to change notification settings - Fork 11
109 lines (91 loc) · 3.1 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Test project
on:
pull_request:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
go-test:
name: Run go testing suite with coverage
runs-on: ubuntu-20.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
# 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@v4
with:
cache: true
cache-dependency-path: go.sum
go-version-file: go.mod
- name: Restore go modules cache
id: cache-go-mod
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: Get dependencies
run: go mod download
- name: Trigger test suite
run: |
# ignoring orch-tester
go test $(go list ./... | grep -v "orch-tester") --short -v --covermode=atomic --coverprofile=coverage.out --coverpkg=./...
- name: Upload coverage reports
uses: codecov/codecov-action@v3
with:
files: ./coverage.out
name: ${{ github.event.repository.name }}
verbose: true
codeql:
name: Perform CodeQL analysis
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: go
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
editorconfig:
name: Run editorconfig checker
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/[email protected]
with:
# Check https://github.com/livepeer/go-livepeer/pull/1891
# for ref value discussion
ref: ${{ github.event.pull_request.head.sha }}
- name: Install editorconfig-checker
uses: editorconfig-checker/action-editorconfig-checker@main
- name: Run editorconfig checker against the repo
run: editorconfig-checker