-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (83 loc) · 2.43 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
name: Trigger test suite
on:
pull_request:
push:
branches:
- main
jobs:
unit-test:
name: Test the catalyst-api project
runs-on: ubuntu-20.04
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@v4
with:
go-version-file: go.mod
cache: true
cache-dependency-path: go.sum
- name: Install go modules
if: steps.go.outputs.cache-hit != 'true'
run: go mod download
- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: ffmpeg
version: 1.0
- name: go fmt
run: |
go fmt ./...
git diff --exit-code
- name: Run tests with coverage
run: |
make generate
go test $(go list ./... | grep -v cucumber) --short --race --covermode=atomic --coverprofile=coverage.out
- name: Upload coverage reports
uses: codecov/codecov-action@v3
with:
files: ./coverage.out
name: ${{ github.event.repository.name }}
verbose: true
cucumber-test:
name: Cucumber tests
runs-on: ubuntu-20.04
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@v4
with:
go-version-file: go.mod
cache: true
cache-dependency-path: go.sum
- name: Install go modules
if: steps.go.outputs.cache-hit != 'true'
run: go mod download
- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: ffmpeg
version: 1.0
- name: Run cucumber tests
run: |
go install github.com/cucumber/godog/cmd/godog@latest
make generate integration-test
- name: Upload logs
uses: actions/upload-artifact@v3
if: failure()
with:
name: cucumber-logs
path: test/logs