-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (57 loc) · 1.84 KB
/
CI.yml
File metadata and controls
67 lines (57 loc) · 1.84 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test:
name: Test on ${{ matrix.os }} / Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
python-version: [ "3.12", "3.13" , "3.14" ]
steps:
# 1. Checkout repository
- name: Checkout code
uses: actions/checkout@v6
# 2. Set up Python
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
# 3. Install build tools
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel pytest pytest-cov
pip install mpich mpi4py
# 4. Install project dependencies (cached via setup-python)
- name: Install project requirements
run: |
pip install -r requirements.txt
# 5. Build wheel (ensures package is installable)
- name: Build wheel
run: |
python -m build --wheel
# 6. Install wheel
- name: Install wheel
run: |
pip install $(python -c "import glob; print(glob.glob('dist/*.whl')[0])")
# 7. Run tests with coverage
- name: Run tests
run: |
pytest tests --cov=moldga --cov-report=term-missing --cov-report=xml -vv
# pytest tests --cov=moldga --cov-report=xml --cov-report=term
# 8. Upload coverage to Codecov (requires CODECOV_TOKEN for private repos)
- name: Upload test results to Codecov
uses: codecov/codecov-action@v6
with:
files: ./coverage.xml
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false