Skip to content

Commit

Permalink
add a routine test of the solutions notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
jpivarski committed Jan 7, 2025
1 parent dbb33f7 commit b8094c9
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/test-solutions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test solutions

on:
push:
branches:
- main
workflow_dispatch:
schedule:
# Every day at 4am UTC (10pm Chicago, 5am Geneva)
- cron: "00 4 * * *"

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install the dependencies
run: |
python -m pip install nbconvert awkward hist[plot] uproot vector
- name: Test the solutions
working-directory: site/files
run: |
jupyter nbconvert --to python solutions-NO-PEEKING.ipynb
sed 's/^# \(In\[[0-9]*\]:\)/print("\1") #/' solutions-NO-PEEKING.py | sed 's/^import piplite.*//' | sed 's/^await piplite.install//' > solutions-NO-PEEKING-RUN.py
cat -n solutions-NO-PEEKING-RUN.py
python solutions-NO-PEEKING-RUN.py

0 comments on commit b8094c9

Please sign in to comment.