Repository navigation
50 lines (47 loc) · 2.09 KB
/
Copy pathci.yml
File metadata and controls
50 lines (47 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: tests
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -r requirements.txt "pytest>=7"
- name: Run tests
run: pytest -q
# Tests run against a synthetic fixture; tests requiring the large
# Hugging Face-hosted .hdf5 files skip automatically when those files are absent.
# The job above never installs torch, so conftest.py skips tests/ (the magnet API tests). This job
# installs the CPU inference stack, verifies the pip-installed package imports from a clean directory
# (catching packaging regressions like a dropped eqV2/Jd.pt), then runs the tests/ API tests. The
# weights-gated inference tests still skip here (checkpoints are not in the repo); everything else runs.
model:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install the CPU inference stack
run: |
pip install torch==2.5.0 --index-url https://download.pytorch.org/whl/cpu
pip install -r magnet/requirements.txt
pip install --no-deps ./magnet
pip install "pytest>=7"
- name: Verify the installed package imports from a clean directory
# Run from OUTSIDE the repo so `import magnet` resolves to the pip-installed package, not the
# local ./magnet source tree that a repo-root run would import instead. This is what catches a
# clean-install failure such as missing package-data (eqV2/Jd.pt is loaded at import time by
# wigner.py); a source-tree run finds Jd.pt on disk and masks the packaging bug.
run: cd "$RUNNER_TEMP" && python -c "import magnet; print('import magnet OK:', magnet.__file__)"
- name: Run the magnet package tests
run: pytest tests/ -q