-
Notifications
You must be signed in to change notification settings - Fork 20
121 lines (103 loc) · 3.15 KB
/
Copy pathbuild.yml
File metadata and controls
121 lines (103 loc) · 3.15 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: build
on:
push:
branches: [master]
pull_request:
branches: ['**']
workflow_dispatch:
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
include:
- python-version: '3.9'
experimental: false
- python-version: '3.10'
experimental: false
- python-version: '3.11'
experimental: false
- python-version: '3.12'
experimental: false
- python-version: '3.13'
experimental: false
- python-version: '3.14'
experimental: true
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.py
- name: Install dependencies (Python 3.8-3.10)
if: contains(fromJSON('["3.8", "3.9", "3.10"]'), matrix.python-version)
run: |
python -m pip install --upgrade pip
pip install "numpy<2" matplotlib
pip install torch torchvision torchaudio
pip install .[dev]
- name: Install dependencies (Python 3.11+)
if: ${{ !contains(fromJSON('["3.8", "3.9", "3.10"]'), matrix.python-version) }}
run: |
python -m pip install --upgrade pip
pip install "numpy<2"
pip install torch torchvision torchaudio
pip install .[dev]
- name: Run tests with coverage
run: |
coverage run -m pytest
coverage xml -o coverage-${{ matrix.python-version }}.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
files: coverage-${{ matrix.python-version }}.xml
flags: py${{ matrix.python-version }}
name: tests-py${{ matrix.python-version }}
docs:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: setup.py
- name: Install docs dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install sphinx sphinx-book-theme myst-nb
- name: Build docs and check links
run: make -C doc html linkcheck
- name: Upload docs artifact
uses: actions/upload-pages-artifact@v3
with:
path: doc/_build/html
deploy-docs:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: docs
permissions:
pages: write
id-token: write
environment:
name: github-pages
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4