mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2026-04-10 12:33:42 +00:00
Set up basic test gh worklows (#79)
* Set up basic test gh worklows * update file paths * env check * add env check * Update requirements.txt * simplify * upd
This commit is contained in:
committed by
GitHub
parent
9d6da22ebb
commit
ca96abac8a
41
.github/workflows/basic-tests.yml
vendored
Normal file
41
.github/workflows/basic-tests.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
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 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
|
||||
Reference in New Issue
Block a user