-
Notifications
You must be signed in to change notification settings - Fork 1
140 lines (118 loc) · 3.86 KB
/
test.yaml
File metadata and controls
140 lines (118 loc) · 3.86 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Trigger test suite
on:
pull_request:
push:
branches:
- main
jobs:
golangci:
name: Lint test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up go
id: go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
cache-dependency-path: go.sum
- name: go generate
run: |
make generate
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
# Optional: golangci-lint command line arguments.
args: --timeout 3m
# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
unit-test:
name: Test the catalyst-api project
runs-on: ubuntu-24.04
steps:
- name: Check out code
uses: actions/checkout@v4
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@v5
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 libblas3 liblapack3
version: 1.0
- name: Fix BLAS library symlinks
run: |
# Create symlinks so libblas.so.3 is in a standard search path
sudo ln -sf /usr/lib/x86_64-linux-gnu/blas/libblas.so.3 /usr/lib/x86_64-linux-gnu/libblas.so.3
sudo ln -sf /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3 /usr/lib/x86_64-linux-gnu/liblapack.so.3
sudo ldconfig
- 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@v4
with:
files: ./coverage.out
name: ${{ github.event.repository.name }}
verbose: true
cucumber-test:
name: Cucumber tests
runs-on: ubuntu-24.04
steps:
- name: Check out code
uses: actions/checkout@v4
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@v5
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 libblas3 liblapack3
version: 1.0
- name: Fix BLAS library symlinks
run: |
# Create symlinks so libblas.so.3 is in a standard search path
sudo ln -sf /usr/lib/x86_64-linux-gnu/blas/libblas.so.3 /usr/lib/x86_64-linux-gnu/libblas.so.3
sudo ln -sf /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3 /usr/lib/x86_64-linux-gnu/liblapack.so.3
sudo ldconfig
- 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@v4
if: failure()
with:
name: cucumber-logs
path: test/logs