Skip to content

Commit 66fb08d

Browse files
authored
Create test_changed_notebooks.yaml
1 parent 54348db commit 66fb08d

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Test Modified Files
2+
3+
on:
4+
push:
5+
branches: [ changed_files ]
6+
pull_request:
7+
branches: [ changed_files ]
8+
9+
jobs:
10+
test_files:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
path: dea-notebooks
18+
19+
# - name: Set up Python
20+
# uses: actions/setup-python@v4
21+
# with:
22+
# python-version: '3.x'
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install pytest pytest-nbval jupyter
28+
29+
- name: Get changed notebook files
30+
id: changed-notebooks
31+
uses: tj-actions/changed-files@v44
32+
with:
33+
files: '**/*.ipynb'
34+
35+
- name: Get changed Python files
36+
id: changed-py-files
37+
uses: tj-actions/changed-files@v44
38+
with:
39+
files: '**/*.py'
40+
41+
- name: Run pytest on changed notebooks
42+
if: steps.changed-notebooks.outputs.any_changed == 'true'
43+
run: |
44+
pytest --nbval-lax ${{ steps.changed-notebooks.outputs.all_changed_files }}
45+
46+
- name: Run pytest on Python files
47+
if: steps.changed-py-files.outputs.any_changed == 'true'
48+
run: |
49+
pytest Tests/dea_tools

0 commit comments

Comments
 (0)