-
Notifications
You must be signed in to change notification settings - Fork 2
192 lines (192 loc) · 5.67 KB
/
continuous-integration.yml
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
on: [push, pull_request]
defaults:
run:
shell: bash
jobs:
build-sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: python -m venv .venv
- run: .venv/bin/pip install build
- run: .venv/bin/python -m build --sdist
- uses: actions/upload-artifact@v3
with:
name: sdist
path: dist/videojitter-*.tar.gz
if-no-files-found: error
build-wheel:
runs-on: ubuntu-latest
needs: build-sdist
steps:
- uses: actions/download-artifact@v3
with:
name: sdist
- run: tar --gzip --extract --verbose --strip-components=1 --file videojitter-*.tar.gz
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- run: python -m venv .venv
- run: .venv/bin/pip install build
- run: .venv/bin/python -m build --wheel
- uses: actions/upload-artifact@v3
with:
name: wheel
path: dist/videojitter-*.whl
if-no-files-found: error
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
needs: build-wheel
env:
VENV_BIN_DIR: ${{ startsWith(matrix.os, 'windows-') && 'Scripts' || 'bin' }}
steps:
- uses: actions/download-artifact@v3
with:
name: wheel
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- run: python -m venv .venv
- run: .venv/$VENV_BIN_DIR/pip install videojitter-*.whl
- run: .venv/$VENV_BIN_DIR/videojitter-generate-spec
--output-spec-file spec.json
env:
PYTHONWARNINGS: error
- run: .venv/$VENV_BIN_DIR/videojitter-generate-fake-recording
--spec-file spec.json
--output-recording-file recording.wav
env:
PYTHONWARNINGS: error
- run: .venv/$VENV_BIN_DIR/videojitter-analyze-recording
--spec-file spec.json
--recording-file recording.wav
--output-edges-csv-file edges.csv
env:
PYTHONWARNINGS: error
- run: .venv/$VENV_BIN_DIR/videojitter-generate-report
--spec-file spec.json
--edges-csv-file edges.csv
--output-chart-file report.html
env:
PYTHONWARNINGS: error
- uses: FedericoCarboni/setup-ffmpeg@v2
- run: .venv/$VENV_BIN_DIR/videojitter-generate-video
--spec-file spec.json
--output-file video.mp4
env:
PYTHONWARNINGS: error
- uses: actions/checkout@v4
with:
path: git
- run: .venv/$VENV_BIN_DIR/pip install -r git/test-requirements.txt
- run: PATH="../.venv/$VENV_BIN_DIR:$PATH" ../.venv/$VENV_BIN_DIR/python -m videojitter_test
working-directory: git
env:
PYTHONWARNINGS: error
- run: git -C git diff --exit-code
if: ${{ !cancelled() }}
- uses: actions/upload-artifact@v3
if: ${{ !cancelled() }}
with:
name: test_output-${{ matrix.os }}
path: git/videojitter_test/cases/*/test_output
if-no-files-found: error
pylint:
runs-on: ubuntu-latest
needs: build-sdist
steps:
- uses: actions/download-artifact@v3
with:
name: sdist
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- run: tar --gzip --extract --verbose --strip-components=1 --file videojitter-*.tar.gz
- run: python -m venv .venv
- run: .venv/bin/pip install --requirement pylint-requirements.txt --requirement requirements.txt
- run: .venv/bin/pylint --verbose src videojitter_test
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: python -m venv .venv
- run: .venv/bin/pip install --requirement black-requirements.txt
- run: .venv/bin/black --diff --check .
sigstore:
runs-on: ubuntu-latest
needs:
- build-sdist
- build-wheel
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: sdist
- uses: actions/download-artifact@v3
with:
name: wheel
- uses: sigstore/[email protected]
with:
inputs: "*"
- uses: actions/upload-artifact@v3
with:
name: sigstore
path: "*.sigstore"
if-no-files-found: error
testpypi:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/videojitter-')
needs:
- build-sdist
- build-wheel
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: sdist
- uses: actions/download-artifact@v3
with:
name: wheel
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
print-hash: true
skip-existing: true
packages-dir: .
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/videojitter-')
needs:
- build-sdist
- build-wheel
- sigstore
# These are not strictly necessary, but it would be dangerous to create a release
# if they fail.
- test
- black
- pylint
- testpypi
permissions:
contents: write
steps:
- uses: actions/download-artifact@v3
with:
name: sdist
- uses: actions/download-artifact@v3
with:
name: wheel
- uses: actions/download-artifact@v3
with:
name: sigstore
- uses: softprops/action-gh-release@v1
with:
draft: true
files: "*"
generate_release_notes: true