Skip to content

Commit b8fca26

Browse files
authored
Merge pull request #95 from LinkedEarth/workflow
Enhance PR test workflow with timeouts and changes
2 parents 8746efc + 6206370 commit b8fca26

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

‎.github/workflows/pr-tests.yml‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,46 @@ on:
33
pull_request:
44
branches: [ main ]
55
workflow_dispatch:
6-
76
jobs:
87
test:
98
runs-on: ubuntu-latest
9+
timeout-minutes: 60
1010
defaults:
1111
run:
1212
shell: bash -l {0}
13+
1314
steps:
1415
- uses: actions/checkout@v4
1516
- uses: conda-incubator/setup-miniconda@v3
1617
with:
1718
activate-environment: pyleo
1819
environment-file: environment.yml
1920
auto-activate-base: false
21+
2022
- name: Install test dependencies
2123
run: |
2224
conda activate pyleo
23-
pip install pytest-xdist nbmake
25+
pip install nbmake
2426
conda list
25-
27+
2628
- name: Test notebooks
2729
run: |
2830
conda activate pyleo
29-
pytest --nbmake -v --tb=long --overwrite --nbmake-timeout=3600 notebooks/*ipynb || true
31+
mkdir -p executed
32+
for nb in notebooks/*.ipynb; do
33+
echo "=== Running $nb ==="
34+
timeout 300 pytest --nbmake -v --tb=long --overwrite --nbmake-timeout=120 "$nb" || true
35+
cp "$nb" executed/
36+
done
3037
3138
- name: Upload executed notebooks
3239
if: always()
3340
uses: actions/upload-artifact@v4
3441
with:
3542
name: executed-notebooks
36-
path: notebooks/*.ipynb
43+
path: executed/*.ipynb
3744

3845
- name: Check for failures
3946
run: |
4047
conda activate pyleo
41-
pytest --nbmake -v --tb=long --nbmake-timeout=3600 notebooks/*ipynb
48+
pytest --nbmake -v --tb=long --nbmake-timeout=120 notebooks/*ipynb

0 commit comments

Comments
 (0)