Skip to content

Commit 1e3b72b

Browse files
committed
Update CI to run on changed notebooks only
1 parent c6d0e75 commit 1e3b72b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/run_tests.yml

+28
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,33 @@ jobs:
1616
python -m pip install -U -r requirements.txt
1717
python -m pip install -U -r requirements_tests.txt
1818
19+
- name: Get changed files - all
20+
id: changed-files-all
21+
uses: tj-actions/changed-files@v44
22+
- name: Get changed files - ipynb
23+
id: changed-files-ipynb
24+
uses: tj-actions/changed-files@v44
25+
with:
26+
files: |
27+
**.ipynb
28+
29+
- name: Set environment variables
30+
run: |
31+
if [ "${{ github.event_name }}" == 'pull_request' ]; then
32+
echo "SHOULD_TEST_ALL_FILES=false" >> $GITHUB_ENV
33+
echo "HAS_ANY_FILE_CHANGED=${{ steps.changed-files-all.outputs.any_changed }}" >> $GITHUB_ENV
34+
echo "LIST_OF_FILE_CHANGED=${{ steps.changed-files-all.outputs.all_changed_files }}" >> $GITHUB_ENV
35+
echo "HAS_ANY_IPYNB_CHANGED=${{ steps.changed-files-ipynb.outputs.any_changed }}" >> $GITHUB_ENV
36+
echo "LIST_OF_IPYNB_CHANGED=${{ steps.changed-files-ipynb.outputs.all_changed_files }}" >> $GITHUB_ENV
37+
elif [ "${{ github.event_name }}" == 'workflow_dispatch' ]; then
38+
echo "SHOULD_TEST_ALL_FILES=true" >> $GITHUB_ENV
39+
echo "HAS_ANY_FILE_CHANGED=None" >> $GITHUB_ENV
40+
echo "LIST_OF_FILE_CHANGED=None" >> $GITHUB_ENV
41+
echo "HAS_ANY_IPYNB_CHANGED=None" >> $GITHUB_ENV
42+
echo "LIST_OF_IPYNB_CHANGED=None" >> $GITHUB_ENV
43+
fi
44+
1945
- name: "Run tests"
2046
run: python -m pytest tests
47+
env:
48+
JUPYTER_PLATFORM_DIRS: "1"

0 commit comments

Comments
 (0)