Skip to content

Commit

Permalink
ignore deleted files for conversion to ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
cbielow committed Sep 6, 2024
1 parent de07b9c commit b86f949
Showing 1 changed file with 60 additions and 60 deletions.
120 changes: 60 additions & 60 deletions .github/workflows/test-pr.yaml
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
name: Build and Test code in notebooks

on:
pull_request:
branches:
- master

jobs:

build-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.10' # Version range or exact version of a Python version to use, using SemVer's version range syntax

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
dir_names_max_depth: 0
files: |
docs/source/*.rst
docs/source/**/*.rst
!docs/source/**/_templates
- uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: '3.1.2'

# - uses: actions/setup-python@v4
# with:
# python-version: '3.7' # Version range or exact version of a Python version to use, using SemVer's version range syntax

- name: Installing Dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade pandocfilters jupyter
python3 -m pip install --upgrade -r requirements.txt
- name: Generating notebooks
run: |
pushd docs/source
./generate_ipynb.sh
popd
- name: Execute all notebooks generated from modified files
run: |
for file in ${{ steps.changed-files.outputs.all_modified_files }}; do
jupyter nbconvert --to notebook --inplace --execute ${file%.rst}.ipynb || (echo "${file%.rst}" >> failed_nbs.txt)
done
if [ -f "failed_nbs.txt" ]; then
echo "Some notebooks failed to run. Please check logs."
cat failed_nbs.txt
exit 1
fi
name: Build and Test code in notebooks

on:
pull_request:
branches:
- master

jobs:

build-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.10' # Version range or exact version of a Python version to use, using SemVer's version range syntax

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
dir_names_max_depth: 0
files: |
docs/source/*.rst
docs/source/**/*.rst
!docs/source/**/_templates
- uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: '3.1.2'

# - uses: actions/setup-python@v4
# with:
# python-version: '3.7' # Version range or exact version of a Python version to use, using SemVer's version range syntax

- name: Installing Dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade pandocfilters jupyter
python3 -m pip install --upgrade -r requirements.txt
- name: Generating notebooks
run: |
pushd docs/source
./generate_ipynb.sh
popd
- name: Execute all notebooks generated from modified files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
jupyter nbconvert --to notebook --inplace --execute ${file%.rst}.ipynb || (echo "${file%.rst}" >> failed_nbs.txt)
done
if [ -f "failed_nbs.txt" ]; then
echo "Some notebooks failed to run. Please check logs."
cat failed_nbs.txt
exit 1
fi

0 comments on commit b86f949

Please sign in to comment.