-
Notifications
You must be signed in to change notification settings - Fork 9
74 lines (71 loc) · 1.87 KB
/
test-gallery.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
# This workflow tests that examples and case studies in the gallery execute
# correctly, and saves any plots produced as artifacts for visual inspection.
#
# It does not test that the documentation builds correctly with Sphinx.
name: Test the gallery of examples and case-studies
on:
push:
branches: [ "main" ]
paths:
- 'p3analysis/**'
- 'examples/**'
- 'case-studies/**'
- 'pyproject.toml'
- 'MANIFEST.in'
pull_request:
branches: [ "main" ]
paths:
- 'p3analysis/**'
- 'examples/**'
- 'case-studies/**'
- 'pyproject.toml'
- 'MANIFEST.in'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install p3analysis and its dependencies
run: pip install --no-cache-dir './[dev]'
- name: Run examples
run: |
for dir in `find examples/* -type d`
do
cd $dir
for f in *.py;
do
python $f 1>/dev/null
done
cd ../../
done
- name: Save examples output
uses: actions/upload-artifact@v4
with:
name: examples-${{ matrix.python-version }}
path: examples/**/*.png
if-no-files-found: error
- name: Run case-studies
run: |
for dir in `find case-studies/* -type d`
do
cd $dir
for f in *.py;
do
python $f 1>/dev/null
done
cd ../../
done
- name: Save case-studies output
uses: actions/upload-artifact@v4
with:
name: case-studies-${{ matrix.python-version }}
path: case-studies/**/*.png
if-no-files-found: error
permissions: read-all