Skip to content

Commit

Permalink
add CI/CD for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xrsrke committed Jan 19, 2024
1 parent a6318ae commit 1c79951
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Run unit tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
paths:
- "src/**.py"
- "examples/**.py"
- "tests/**.py"

jobs:
tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Check container state
run: |
nvidia-smi
python -c "import torch; print('torch:', torch.__version__, torch)"
python -c "import torch; print('CUDA available:', torch.cuda.is_available())"
- name: Instal nanotron
run: |
python -m pip install --upgrade pip
pip install torch
pip install packaging; pip install "flash-attn>=2.4.2" --no-build-isolation
git clone [email protected]:huggingface/nanotron.git
cd nanotron
pip install -e .
- name: Install test dependencies
run: |
pip install pytest
pip install pytest-cov
- name: Python dependencies
run: |
pip list
- name: Run tests
run: pytest --color=yes --durations=0 --verbose tests/
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,5 @@ cython_debug/
#.idea/

.vscode
.github

checkpoints/

0 comments on commit 1c79951

Please sign in to comment.