88
99env :
1010 UV_NO_SYNC : 1
11- PYTHON_VERSION : 3.14
1211
1312jobs :
14- tests-full-install :
15- name : Run tests with full install
16- runs-on : ${{ matrix.os }}
13+ tests :
14+ # Default config: py3.14, ubuntu-latest, float32, full options.
15+ # The idea is to make each of those params vary one by one, to limit the number of tests to run.
16+ name : Run tests (py${{ matrix.python-version || '3.14' }}, ${{ matrix.os || 'ubuntu-latest' }}, ${{ matrix.dtype || 'float32' }}, ${{ matrix.options || 'full' }})
17+ runs-on : ${{ matrix.os || 'ubuntu-latest' }}
1718 strategy :
18- fail-fast : false # Ensure matrix jobs keep running even if one fails
19+ fail-fast : false
1920 matrix :
20- python-version : ['3.10', '3.11', '3.12', '3.13', '3.14']
21- os : [ubuntu-latest, macOS-latest, windows-latest]
21+ include :
22+ # Python version variations
23+ - python-version : ' 3.10'
24+ - python-version : ' 3.11'
25+ - python-version : ' 3.12'
26+ - python-version : ' 3.13'
27+ - python-version : ' 3.14' # To actually run the default config
28+ # OS variations
29+ - os : macOS-latest
30+ - os : windows-latest
31+ # dtype variations
32+ - dtype : float64
33+ # Installation options variations
34+ - options : ' none'
2235
2336 steps :
24- - uses : actions/checkout@v4
25- - name : Set up uv
26- uses : astral-sh/setup-uv@v5
27- with :
28- python-version : ${{ matrix.python-version }}
29- - name : Install default (with full options) and test dependencies
30- run : uv pip install --python-version=${{ matrix.python-version }} -e '.[full]' --group test
31- - name : Run unit and doc tests with coverage report
32- run : uv run pytest -W error tests/unit tests/doc --cov=src --cov-report=xml
33- - name : Upload results to Codecov
34- uses : codecov/codecov-action@v4
35- with :
36- token : ${{ secrets.CODECOV_TOKEN }}
37+ - name : Checkout repository
38+ uses : actions/checkout@v4
3739
38- tests-default-install :
39- name : Run (most) tests with default install
40- runs-on : ubuntu-latest
41- steps :
42- - uses : actions/checkout@v4
4340 - name : Set up uv
4441 uses : astral-sh/setup-uv@v5
4542 with :
46- python-version : ${{ env.PYTHON_VERSION }}
47- - name : Install default (without any option) and test dependencies
48- run : uv pip install --python-version=${{ env.PYTHON_VERSION }} -e . --group test
49- - name : Run unit and doc tests with coverage report
50- run : |
51- uv run pytest -W error tests/unit tests/doc \
52- --ignore tests/unit/aggregation/test_cagrad.py \
53- --ignore tests/unit/aggregation/test_nash_mtl.py \
54- --ignore tests/doc/test_aggregation.py \
55- --cov=src --cov-report=xml
56- - name : Upload results to Codecov
57- uses : codecov/codecov-action@v4
58- with :
59- token : ${{ secrets.CODECOV_TOKEN }}
43+ python-version : ${{ matrix.python-version || '3.14' }}
6044
61- tests-float64 :
62- name : Run tests on float64 dtype
63- runs-on : ubuntu-latest
64- steps :
65- - uses : actions/checkout@v4
66- - name : Set up uv
67- uses : astral-sh/setup-uv@v5
45+ - uses : ./.github/actions/install-deps
6846 with :
69- python-version : ${{ env.PYTHON_VERSION }}
70- - name : Install default (with full options) and test dependencies
71- run : uv pip install --python-version=${{ env.PYTHON_VERSION }} -e '.[full]' --group test
72- - name : Run unit and doc tests with coverage report
47+ options : ${{ matrix.options || 'full' }}
48+ groups : test
49+
50+ - name : Run tests
7351 run : uv run pytest -W error tests/unit tests/doc --cov=src --cov-report=xml
7452 env :
75- PYTEST_TORCH_DTYPE : float64
76- - name : Upload results to Codecov
53+ PYTEST_TORCH_DTYPE : ${{ matrix.dtype || 'float32' }}
54+
55+ - &upload-codecov
56+ name : Upload results to Codecov
7757 uses : codecov/codecov-action@v4
7858 with :
7959 token : ${{ secrets.CODECOV_TOKEN }}
@@ -88,10 +68,11 @@ jobs:
8868 - name : Set up uv
8969 uses : astral-sh/setup-uv@v5
9070 with :
91- python-version : ${{ env.PYTHON_VERSION }}
71+ python-version : ' 3.14 '
9272
93- - name : Install dependencies (default with full options & doc)
94- run : uv pip install --python-version=${{ env.PYTHON_VERSION }} -e '.[full]' --group doc
73+ - uses : ./.github/actions/install-deps
74+ with :
75+ groups : doc
9576
9677 - name : Build Documentation
9778 working-directory : docs
@@ -101,16 +82,17 @@ jobs:
10182 name : Run mypy
10283 runs-on : ubuntu-latest
10384 steps :
104- - name : Checkout repository
105- uses : actions/checkout@v4
85+ - name : Checkout repository
86+ uses : actions/checkout@v4
10687
107- - name : Set up uv
108- uses : astral-sh/setup-uv@v5
109- with :
110- python-version : ${{ env.PYTHON_VERSION }}
88+ - name : Set up uv
89+ uses : astral-sh/setup-uv@v5
90+ with :
91+ python-version : ' 3.14 '
11192
112- - name : Install dependencies (default with full options & check)
113- run : uv pip install --python-version=${{ env.PYTHON_VERSION }} -e '.[full]' --group check
93+ - uses : ./.github/actions/install-deps
94+ with :
95+ groups : check
11496
115- - name : Run mypy
116- run : uv run mypy src/torchjd
97+ - name : Run mypy
98+ run : uv run mypy src/torchjd
0 commit comments