-
Notifications
You must be signed in to change notification settings - Fork 76
200 lines (165 loc) · 4.9 KB
/
ci.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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: ytld-sub CI (Linux)
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
test-lint:
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Run linters
run: |
pip install -e .[lint]
make check_lint
test-unit:
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Run unit tests with coverage
run: |
pip install -e .[test]
sudo apt-get update
sudo apt-get install -y ffmpeg
coverage run -m pytest --reruns 3 --reruns-delay 5 tests/unit && coverage xml -o /opt/coverage/unit/coverage.xml
- name: Save coverage
uses: actions/cache@v3
with:
path: /opt/coverage/unit
key: ${{github.sha}}-coverage-unit
test-soundcloud:
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Run e2e soundcloud tests with coverage
run: |
pip install -e .[test]
sudo apt-get update
sudo apt-get install -y ffmpeg
coverage run -m pytest --reruns 3 --reruns-delay 5 tests/e2e/soundcloud && coverage xml -o /opt/coverage/soundcloud/coverage.xml
test-bandcamp:
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Run e2e soundcloud tests with coverage
run: |
pip install -e .[test]
sudo apt-get update
sudo apt-get install -y ffmpeg
coverage run -m pytest --reruns 3 --reruns-delay 5 tests/e2e/bandcamp && coverage xml -o /opt/coverage/bandcamp/coverage.xml
- name: Save coverage
uses: actions/cache@v3
with:
path: /opt/coverage/bandcamp
key: ${{github.sha}}-coverage-bandcamp
test-youtube:
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Run e2e youtube tests with coverage
run: |
pip install -e .[test]
sudo apt-get update
sudo apt-get install -y ffmpeg
coverage run -m pytest --reruns 3 --reruns-delay 5 tests/e2e/youtube && coverage xml -o /opt/coverage/youtube/coverage.xml
- name: Save coverage
uses: actions/cache@v3
with:
path: /opt/coverage/youtube
key: ${{github.sha}}-coverage-youtube
test-plugins:
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Run e2e plugin tests with coverage
run: |
pip install -e .[test]
sudo apt-get update
sudo apt-get install -y ffmpeg
coverage run -m pytest --reruns 3 --reruns-delay 5 tests/e2e/plugins && coverage xml -o /opt/coverage/plugins/coverage.xml
- name: Save coverage
uses: actions/cache@v3
with:
path: /opt/coverage/plugins
key: ${{github.sha}}-coverage-plugins
codecov-upload:
runs-on: ubuntu-22.04
needs: [
test-unit,
test-soundcloud,
test-bandcamp,
test-youtube,
test-plugins
]
permissions:
contents: read
steps:
- name: Restore unit test coverage
uses: actions/cache@v3
with:
path: /opt/coverage/unit
key: ${{github.sha}}-coverage-unit
- name: Restore soundcloud test coverage
uses: actions/cache@v3
with:
path: /opt/coverage/soundcloud
key: ${{github.sha}}-coverage-soundcloud
- name: Restore bandcamp test coverage
uses: actions/cache@v3
with:
path: /opt/coverage/bandcamp
key: ${{github.sha}}-coverage-bandcamp
- name: Restore youtube test coverage
uses: actions/cache@v3
with:
path: /opt/coverage/youtube
key: ${{github.sha}}-coverage-youtube
- name: Restore plugins test coverage
uses: actions/cache@v3
with:
path: /opt/coverage/plugins
key: ${{github.sha}}-coverage-plugins
- name: Upload code coverage to codecov.io
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /opt/coverage/unit/coverage.xml,/opt/coverage/soundcloud/coverage.xml,/opt/coverage/bandcamp/coverage.xml,/opt/coverage/youtube/coverage.xml,/opt/coverage/plugins/coverage.xml