-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (114 loc) · 3.43 KB
/
Copy pathci.yml
File metadata and controls
145 lines (114 loc) · 3.43 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Set up Python
run: uv python install
- name: Install dependencies
run: uv sync --extra cpu --extra dev
- name: Ruff lint
run: uv run ruff check master_thesis_code/ master_thesis_code_test/
- name: Ruff format check
run: uv run ruff format --check master_thesis_code/ master_thesis_code_test/
- name: mypy
run: uv run mypy master_thesis_code/ master_thesis_code_test/
- name: pytest (CPU only)
run: uv run pytest -m "not gpu and not slow"
- name: Upload coverage report
uses: actions/upload-artifact@v7
with:
name: coverage-xml
path: coverage.xml
integration:
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Set up Python
run: uv python install
- name: Install dependencies
run: uv sync --extra cpu --extra dev
- name: Run integration tests
run: uv run pytest -m slow --save-test-plots -v
- name: Upload test plots artifact
if: always()
uses: actions/upload-artifact@v7
with:
name: integration-test-plots
path: test-artifacts/
if-no-files-found: ignore
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Set up Python
run: uv python install
- name: Install dependencies
run: uv sync --extra cpu --extra dev
- name: Build docs
run: uv run make -C docs html SPHINXOPTS="-W"
- name: Upload docs artifact
uses: actions/upload-artifact@v7
with:
name: docs-html
path: docs/build/html/
pages:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [integration, docs]
permissions:
pages: write
id-token: write
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Set up Python
run: uv python install
- name: Install dependencies
run: uv sync --extra cpu --extra dev
- name: Download docs artifact
uses: actions/download-artifact@v8
with:
name: docs-html
path: _site/
- name: Download test plots artifact
uses: actions/download-artifact@v8
with:
name: integration-test-plots
path: _site/test-plots/
continue-on-error: true
- name: Generate interactive figures
run: |
mkdir -p _site/interactive
cp interactive/*.html _site/interactive/
if [ -d cluster_results ]; then
uv run python -m master_thesis_code cluster_results --generate_interactive _site/interactive/ || true
fi
continue-on-error: true
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: _site/
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4