-
Notifications
You must be signed in to change notification settings - Fork 7
215 lines (194 loc) · 6.31 KB
/
main.yml
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: CI testing
on:
pull_request:
push:
branches: [develop, main, alpha-test]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install --upgrade pip
- run: pip install .[build]
- name: Get Version
id: get_version
run: python -m setuptools_scm
- run: python -m build --sdist --wheel
- run: pip install .
- run: pip uninstall -y montepy
- run: pip install --user dist/*.whl
# run scripts
- run: change_to_ascii -h
- run: pip uninstall -y montepy
- run: pip install --user dist/*.tar.gz
- run: pip install --user . montepy[test]
- run: pip install --user . montepy[doc]
- run: pip install --user . montepy[format]
- run: pip install --user . montepy[build]
- run: pip install --user . montepy[develop]
- run: pip freeze
- name: Upload build artifacts
uses: actions/[email protected]
if: ${{ matrix.python-version == '3.12' && matrix.numpy-version == '2.0' }}
with:
name: build
path: dist/*
test:
runs-on: ubuntu-latest
permissions:
actions: write
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
numpy-version: ["1.0", "2.0"]
steps:
- uses: actions/checkout@v4
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install numpy~=${{ matrix.numpy-version }}
name: install specific numpy version
- run: pip install --user . montepy[test]
- run: pip install --user . montepy[build]
- run: pip uninstall -y pytest-profiling
name: Uninstall incompatible library
if: ${{ matrix.python-version == '3.13' }}
- run: pip freeze
- run: coverage run -m pytest --junitxml=test_report.xml
- run: coverage report
if: ${{ success() || failure() }}
- run: coverage xml
if: ${{ success() || failure() }}
- name: Upload test report
if: ${{ matrix.python-version == '3.12' && matrix.numpy-version == '2.0' && (success() || failure() )}}
uses: actions/upload-artifact@v4
with:
name: test
path: test_report.xml
- name: Upload coverage report
if: ${{ matrix.python-version == '3.12' && matrix.numpy-version == '2.0' && (success() || failure() )}}
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.xml
- name: Coveralls GitHub Action
if: ${{ matrix.python-version == '3.12' && matrix.numpy-version == '2.0' && (success() || failure() )}}
uses: coverallsapp/github-action@v2
with:
file: coverage.xml
github-token: ${{ secrets.github_token }}
doc-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: set up python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- run: pip install . montepy[doc,build]
- run: sphinx-build doc/source/ doc/build/html -W --keep-going -E
name: Build site strictly
- uses: actions/upload-artifact@v4
with:
name: website
path: doc/build
- name: Test for missing API documentation
run: |
cd doc/source
python _test_for_missing_docs.py
- name: Test for broken hyperlinks
run: |
cd doc
make linkcheck
- name: test sitemap
run: python .github/scripts/check_sitemap.py
doc-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: set up python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- run: pip install . montepy[doc,build,demo-test,test]
- run: python -m phmutest README.md --replmode --log
name: Test readme code
- run: |
cd doc
make doctest
name: Test all example code in documentation.
- run: |
cd demo
for file in *.ipynb; do papermill $file foo.ipynb; done
name: Test all demo notebooks
format-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- run: pip install . montepy[format]
- run: black --check montepy/ tests/
profile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- run: pip install . montepy[test]
- run: pytest --profile
name: Profile test suite
- run: python prof/dump_results.py
name: Display pytest profiling data
- run: python prof/profile_big_model.py
name: Profile against big model
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- run: pip install . montepy[test]
- run: python benchmark/benchmark_big_model.py
name: Benchmark against big model
changelog-test:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Check for changes
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
changelog:
- 'doc/source/changelog.rst'
code:
- 'montepy/**'
- if: (steps.changes.outputs.changelog == 'false') && steps.changes.outputs.code == 'true'
run: |
echo "Changelog not updated"
exit 1