-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (76 loc) · 2.11 KB
/
ci.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
name: build
on:
workflow_dispatch:
schedule:
- cron: 0 0 * * 0 # weekly
push:
branches:
- main
pull_request:
branches:
- main
# want pooch to raise an error if I've updated the file and forgot to update the
# hash.
env:
POOCH_ALLOW_UPDATES: false
jobs:
# based on https://slashgear.github.io/how-to-split-test-by-folder-with-github-action/
notebooks:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
fail-fast: false
name: Execute notebooks
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.py
- name: Setup FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3.1
- name: Install dependencies
run: |
pip install --upgrade --upgrade-strategy eager .[dev,nb] papermill
- name: Run notebooks
run: |
for file in notebooks/*ipynb; do
jupyter execute $file --kernel_name=python3
done
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
fail-fast: false
name: Run pytest scripts
steps:
- uses: actions/checkout@v4
- name: Install Python 3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.py
- name: Install dependencies
run: |
# using the --upgrade and --upgrade-strategy eager flags ensures that
# pip will always install the latest allowed version of all
# dependencies, to make sure the cache doesn't go stale
pip install --upgrade --upgrade-strategy eager .[dev]
- name: Run tests with pytest
run: |
pytest
check:
if: always()
needs:
- notebooks
- tests
runs-on: ubuntu-latest
steps:
- name: Decide whether all tests and notebooks succeeded
uses: re-actors/alls-green@afee1c1eac2a506084c274e9c02c8e0687b48d9e # v1.2.2
with:
jobs: ${{ toJSON(needs) }}