Add and link bonus material (#84) #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Python Scripts and Notebooks | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- '**/*.py' # Run workflow for changes in Python files | |
- '**/*.ipynb' # Run workflow for changes in Jupyter notebooks | |
pull_request: | |
branches: [ main ] | |
paths: | |
- '**/*.py' | |
- '**/*.ipynb' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest nbval | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Test Selected Python Scripts | |
run: | | |
pytest ch04/01_main-chapter-code/tests.py | |
pytest ch05/01_main-chapter-code/tests.py | |
pytest appendix-A/02_installing-python-libraries/tests.py | |
- name: Validate Selected Jupyter Notebooks | |
run: | | |
pytest --nbval ch02/01_main-chapter-code/dataloader.ipynb | |
pytest --nbval ch03/01_main-chapter-code/multihead-attention.ipynb |