Skip to content

Commit 1600f75

Browse files
ci: add GitHub Actions workflow for automated testing
- Add .github/workflows/ci.yml to trigger on push/PR to main - Configure workflow to checkout code and install Python 3.9 - Install CPU-only version of PyTorch to optimize CI run time - Add formatting check using black --check - Add unit test execution using pytest
1 parent 9d4df8c commit 1600f75

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "main", "master" ]
6+
pull_request:
7+
branches: [ "main", "master" ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Check out repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python 3.9
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.9"
21+
cache: "pip"
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
27+
pip install -e .[dev]
28+
29+
- name: Check formatting with black
30+
run: |
31+
black --check .
32+
33+
- name: Test with pytest
34+
run: |
35+
pytest tests/

0 commit comments

Comments
 (0)