-
Notifications
You must be signed in to change notification settings - Fork 4
168 lines (158 loc) · 5.41 KB
/
tests-on-push.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
---
name: Tests on Push
on:
merge_group:
push:
branches-ignore:
- main
jobs:
build-docs:
name: Build docs
runs-on: ubuntu-latest
steps:
# Setup
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry self add poetry-exec-plugin
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
# attempt to restore dependencies from cache (if successful, the following `poetry install` will be a no-op)
cache: poetry
- name: Install Python dependencies
run: poetry install
# run tests
- name: build docs
run: poetry run mkdocs build --strict
- name: check external links in docs
run: |
npm install -g markdown-link-validator
poetry exec check-links
- name: markdownlint
run: poetry exec markdownlint
lint:
name: Lint code
runs-on: ubuntu-latest
steps:
# Setup
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry self add poetry-exec-plugin
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
# attempt to restore dependencies from cache (if successful, the following `poetry install` will be a no-op)
cache: poetry
- name: Install Python dependencies
run: poetry install
# run tests
- name: Linting with ruff
run: poetry exec ruff-check-github
- name: Formatting with ruff
run: poetry exec ruff-format
- name: Linting with mypy
run: poetry exec mypy
- name: Linting with darglint
run: poetry exec darglint
unittests:
name: Run Unittests
runs-on: ubuntu-latest
steps:
# Setup
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry self add poetry-exec-plugin
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
# attempt to restore dependencies from cache (if successful, the following `poetry install` will be a no-op)
cache: poetry
- name: Install Python dependencies
run: poetry install
# run tests
- name: unittests
run: poetry exec unittests
benchmarking:
name: Run Benchmarking
runs-on: ubuntu-latest
steps:
# Setup
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry self add poetry-exec-plugin
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
# attempt to restore dependencies from cache (if successful, the following `poetry install` will be a no-op)
cache: poetry
- name: Install Python dependencies
run: poetry install
# run tests
- name: benchmarking
run: poetry run pytest -s test/benchmarking/
e2e-tests:
name: Run E2E/Integration Tests
runs-on: ubuntu-latest
steps:
# Setup
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry self add poetry-exec-plugin
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
# attempt to restore dependencies from cache (if successful, the following `poetry install` will be a no-op)
cache: poetry
- name: Install Python dependencies
run: poetry install
# Install programs for local processing (fast xmlupload)
- name: Fast xmlupload - Install ffmpeg
uses: FedericoCarboni/setup-ffmpeg@v2
- name: Fast xmlupload - ImageMagick - look for cached AppImage
# If a cache is found that matches "key", the cached files are restored to "path".
# If no cache is found, this step is skipped, and when all jobs are done, the files in "path" are cached under "key".
id: search-cached-imagemagick
uses: actions/cache@v3
with:
path: ~/bin/magick # AppImage containing all binaries + dependencies
key: imagemagick # don't check for a new version, because version checking is fairly complex
- name: Fast xmlupload - ImageMagick - Installation
if: ${{ steps.search-cached-imagemagick.outputs.cache-hit != 'true' }}
uses: mfinelli/setup-imagemagick@v2 # downloads the "magick" AppImage to ~/bin/magick
# run tests
- name: start stack
run: poetry run dsp-tools start-stack --no-prune
- name: e2e tests
run: poetry exec e2e-tests
- name: stop stack # see if this command can run (it isn't tested anywhere else)
run: poetry run dsp-tools stop-stack