Skip to content

Use max size properly #46

Use max size properly

Use max size properly #46

Workflow file for this run

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@v4
- name: Set up Python
uses: actions/setup-python@v5
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