Skip to content

feat: adding workflow file to run notebooks #1

feat: adding workflow file to run notebooks

feat: adding workflow file to run notebooks #1

Workflow file for this run

name: Running Notebooks
on:
pull_request:
schedule:
- cron: '0 0 */14 * *' # Every 14 days at midnight UTC
workflow_dispatch:
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
HF_API_TOKEN: ${{ secrets.HUGGINGFACE_API_KEY }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies and kernel
run: |
python -m pip install --upgrade pip
pip install nbconvert nbformat papermill ipykernel
python -m ipykernel install --user
- name: Run notebooks (using skip file)
run: |
SKIP_FILE=".github/workflows/skip_notebooks"
mapfile -t SKIP_LIST < "$SKIP_FILE"
for notebook in $(find . -name "*.ipynb"); do
skip=false
for skip_item in "${SKIP_LIST[@]}"; do
if [[ "$notebook" == "$skip_item" ]]; then
echo "Skipping $notebook"
skip=true
break
fi
done
if ! $skip; then
echo "Testing $notebook"
papermill "$notebook" /dev/null
fi
done