-
Notifications
You must be signed in to change notification settings - Fork 16
63 lines (54 loc) · 1.56 KB
/
test.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
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]
workflow_dispatch:
workflow_call:
env:
MPLBACKEND: Agg # non-interactive backend for matplotlib
jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest]
split: [1, 2, 3, 4]
uses: janosh/workflows/.github/workflows/pytest.yml@main
with:
os: ${{ matrix.os }}
python-version: "3.10"
install-cmd: uv pip install -e '.[test,brillouin]' --system
test-cmd: pytest --durations 20 --cov . --splits 4 --group ${{ matrix.split }} --splitting-algorithm least_duration
find-scripts:
runs-on: ubuntu-latest
outputs:
script_list: ${{ steps.set-matrix.outputs.script_list }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Find Python scripts
id: set-matrix
run: |
SCRIPTS=$(find assets/scripts -name "*.py" | jq -R -s -c 'split("\n")[:-1]')
echo "script_list=$SCRIPTS" >> $GITHUB_OUTPUT
test-scripts:
needs: find-scripts
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
script: ${{fromJson(needs.find-scripts.outputs.script_list)}}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install package and dependencies
run: pip install -e .[make-assets]
- name: Run script
run: python ${{ matrix.script }}