Skip to content

Commit

Permalink
changes action to validate json only
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelweinold committed Nov 18, 2023
1 parent ed2fba8 commit 050ba61
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/test_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
pull_request:
branches:
- main
paths-ignore:
- '.github/**'
workflow_dispatch:

jobs:
Expand All @@ -17,14 +19,9 @@ jobs:
uses: actions/setup-python@v4 # https://github.com/actions/setup-python/releases
with:
python-version: 3.11

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install nbqa pylint

- name: Test all Jupyter Notebooks with 'nbqa'
- name: Validate Jupyter Notebooks JSON Format
run: |
for file in $(find . -name "*.ipynb"); do
nbqa pylint "$file" || { echo "Test failed for $file"; exit 1; }
done
for file in $(find . -name "*.ipynb"); do
python -c "import json; json.loads(open('$file').read())" || { echo "Validation failed for $file"; exit 1; }
done

0 comments on commit 050ba61

Please sign in to comment.