-
Notifications
You must be signed in to change notification settings - Fork 15
96 lines (83 loc) · 3 KB
/
tests.yml
File metadata and controls
96 lines (83 loc) · 3 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Tests
on:
pull_request:
workflow_dispatch:
schedule:
- cron: '41 16 * * *' # Every day at 16:41 UTC (to avoid high load at exact hour values).
env:
UV_NO_SYNC: 1
PYTHON_VERSION: 3.14
jobs:
tests-full-install:
name: Run tests with full install
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # Ensure matrix jobs keep running even if one fails
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install default (with full options) and test dependencies
run: uv pip install --python-version=${{ matrix.python-version }} -e '.[full]' --group test
- name: Run unit and doc tests with coverage report
run: uv run pytest -W error tests/unit tests/doc --cov=src --cov-report=xml
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
tests-default-install:
name: Run (most) tests with default install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install default (without any option) and test dependencies
run: uv pip install --python-version=${{ env.PYTHON_VERSION }} -e . --group test
- name: Run unit and doc tests with coverage report
run: |
uv run pytest -W error tests/unit tests/doc \
--ignore tests/unit/aggregation/test_cagrad.py \
--ignore tests/unit/aggregation/test_nash_mtl.py \
--ignore tests/doc/test_aggregation.py \
--cov=src --cov-report=xml
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
build-doc:
name: Build doc
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies (default with full options & doc)
run: uv pip install --python-version=${{ env.PYTHON_VERSION }} -e '.[full]' --group doc
- name: Build Documentation
working-directory: docs
run: uv run make dirhtml
mypy:
name: Run mypy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies (default with full options & check)
run: uv pip install --python-version=${{ env.PYTHON_VERSION }} -e '.[full]' --group check
- name: Run mypy
run: uv run mypy src/torchjd