-
Notifications
You must be signed in to change notification settings - Fork 114
339 lines (328 loc) · 11.3 KB
/
Copy pathmain.yml
File metadata and controls
339 lines (328 loc) · 11.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
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
name: CI
on:
push:
paths-ignore:
- 'docs/**'
branches: [ master ]
tags:
- '*'
pull_request:
paths-ignore:
- 'docs/**'
branches: [ master ]
schedule:
- cron: '0 0 * * 0,3'
workflow_dispatch:
concurrency:
group: ${{ github.ref }}-ci
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
GEANT4_VERSION: 'v11.4.2'
ITK_VERSION: 'v5.4.4'
jobs:
build_opengate_wheel:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
python-version: ['3.10']
steps:
- name: Checkout github repo
uses: actions/checkout@v6
- name: Checkout submodules
shell: bash -l {0}
run: |
export GIT_SSL_NO_VERIFY=1
git submodule update --init --recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Create opengate Wheel
run: |
rm -rf $GITHUB_WORKSPACE/opengate/tests/data
cp $GITHUB_WORKSPACE/.git/modules/gam-tests/data/HEAD $GITHUB_WORKSPACE/opengate/tests/
pip install build
python -m build
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: dist-opengate
path: dist/
build_opengate_core_wheel_pr:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-15, windows-2025]
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
exclude:
- os: macos-15
python-version: '3.10'
- os: windows-2025
python-version: '3.10'
steps:
- name: Checkout github repo
uses: actions/checkout@v6
- name: Checkout submodules
shell: bash -l {0}
run: |
if [[ ${{ matrix.os }} == "windows-2025" ]]; then
set "GIT_SSL_NO_VERIFY=1"
else
export GIT_SSL_NO_VERIFY=1
fi
git submodule update --init --recursive
- uses: ./.github/workflows/actions_build
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: dist-${{ matrix.os }}-${{ matrix.python-version }}-opengate-core
path: dist/
build_opengate_core_wheel_ci_or_tag:
if: (github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')) || (github.event_name == 'schedule')
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04-arm, macos-15-intel]
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
exclude:
- os: macos-15
python-version: '3.10'
- os: windows-2025
python-version: '3.10'
- os: macos-15-intel
python-version: '3.14'
steps:
- name: Checkout github repo
uses: actions/checkout@v6
- name: Checkout submodules
shell: bash -l {0}
run: |
if [[ ${{ matrix.os }} == "windows-11-arm" ]]; then
set "GIT_SSL_NO_VERIFY=1"
else
export GIT_SSL_NO_VERIFY=1
fi
git submodule update --init --recursive
- uses: ./.github/workflows/actions_build
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: dist-${{ matrix.os }}-${{ matrix.python-version }}-opengate-core-ci_or_tag
path: dist/
build_opengate_core_novis_wheel:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- name: Checkout github repo
uses: actions/checkout@v6
- name: Checkout submodules
shell: bash -l {0}
run: |
export GIT_SSL_NO_VERIFY=1
git submodule update --init --recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Get OS version
id: get-os-version
shell: bash -l {0}
run: |
varOS=`cat /etc/os-release | grep "VERSION=" | grep -oP '(?<=\").*?(?=\")'`
varOS=($varOS)
varOS=${varOS[0]}
varOS="${varOS}-intel"
echo "release=${varOS}" >> $GITHUB_OUTPUT
- name: Cache modules
id: cache_opengate_core_dependencies
uses: actions/cache@v4
with:
path: ~/software
key: ${{ runner.os }}-${{ steps.get-os-version.outputs.release }}_geant4_${{ env.GEANT4_VERSION }}_itk_${{ env.ITK_VERSION }}_build
restore-keys: ${{ runner.os }}-${{ steps.get-os-version.outputs.release }}_geant4_${{ env.GEANT4_VERSION }}_itk_${{ env.ITK_VERSION }}_build
- name: Create opengate_core_novis Wheel Linux
run: |
if [ ${{ matrix.python-version }} == "3.10" ]; then
export PYTHONFOLDER="cp310-cp310"
elif [ ${{ matrix.python-version }} == "3.11" ]; then
export PYTHONFOLDER="cp311-cp311"
elif [ ${{ matrix.python-version }} == "3.12" ]; then
export PYTHONFOLDER="cp312-cp312"
elif [ ${{ matrix.python-version }} == "3.13" ]; then
export PYTHONFOLDER="cp313-cp313"
elif [ ${{ matrix.python-version }} == "3.14" ]; then
export PYTHONFOLDER="cp314-cp314"
fi
mkdir -p $HOME/software
docker run --rm -e "PYTHONFOLDER=${PYTHONFOLDER}" -v $GITHUB_WORKSPACE:/home tbaudier/opengate_core:${{ env.GEANT4_VERSION }}_novis /home/.github/workflows/createWheelLinux_novis.sh
ls wheelhouse
rm -rf dist
mv wheelhouse dist
sudo chown -R runner:docker dist
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: dist-${{ matrix.os }}-${{ matrix.python-version }}-opengate-core-novis
path: dist/
publish_wheel:
runs-on: ubuntu-24.04
needs: [build_opengate_wheel, build_opengate_core_wheel_pr, build_opengate_core_wheel_ci_or_tag, build_opengate_core_novis_wheel]
steps:
- name: Checkout github repo
uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
pattern: dist-*
merge-multiple: true
path: dist/
- name: Separate the wheels
run: |
mkdir dist_opengate_core dist_opengate dist_opengate_core_novis
mv dist/opengate_core_novis-* dist_opengate_core_novis/ || true
mv dist/opengate_core_ci* dist_opengate_core/ || true
mv dist/opengate_core-* dist_opengate_core/
mv dist/opengate-* dist_opengate/
- name: Publish to PyPI opengate_core_novis
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_OPENGATE_CORE_NOVIS }}
packages-dir: dist_opengate_core_novis/
skip-existing: true
- name: Publish to PyPI opengate_core
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_OPENGATE_CORE }}
packages-dir: dist_opengate_core/
skip-existing: true
- name: Publish to PyPI opengate
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_OPENGATE }}
packages-dir: dist_opengate/
skip-existing: true
# ssh_session:
# env:
# GEANT4_VERSION: 'v11.4.2'
# ITK_VERSION: 'v5.4.4'
# runs-on: macos-13
# steps:
# - name: Checkout github repo
# uses: actions/checkout@v6
# - name: Checkout submodules
# shell: bash -l {0}
# run: |
# export GIT_SSL_NO_VERIFY=1
# git submodule update --init --recursive
# - name: Set up Python
# uses: actions/setup-python@v6
# with:
# python-version: 3.9
# architecture: 'x64'
# - name: Get OS version
# id: get-os-version
# shell: bash -l {0}
# run: |
# varOS=`sw_vers | grep "ProductVersion:"`
# varOS="${varOS#*:}"
# echo "release=${varOS:1}" >> $GITHUB_OUTPUT
# - name: Cache modules
# id: cache_opengate_core_dependencies
# uses: actions/cache@v4
# with:
# path: ~/software
# key: ${{ runner.os }}-${{ steps.get-os-version.outputs.release }}_geant4_${{ env.GEANT4_VERSION }}_itk_${{ env.ITK_VERSION }}_build
# restore-keys: ${{ runner.os }}-${{ steps.get-os-version.outputs.release }}_geant4_${{ env.GEANT4_VERSION }}_itk_${{ env.ITK_VERSION }}_build
# - uses: conda-incubator/setup-miniconda@v3
# with:
# miniconda-version: "latest"
# auto-update-conda: true
# activate-environment: opengate_core
# python-version: 3.9
# - name: Set up Homebrew
# id: set-up-homebrew
# uses: Homebrew/actions/setup-homebrew@master
# - name: Start SSH session
# uses: luchihoratiu/debug-via-ssh@main
# with:
# NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
# SSH_PASS: ${{ secrets.SSH_PASS }}
test_wheel_pr:
runs-on: ${{ matrix.os }}
needs: [build_opengate_wheel, build_opengate_core_wheel_pr]
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-15, windows-2025]
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
exclude:
- os: macos-15
python-version: '3.10'
- os: windows-2025
python-version: '3.10'
steps:
- name: Checkout github repo
uses: actions/checkout@v6
- uses: ./.github/workflows/actions_tests
publish_test:
runs-on: ubuntu-24.04
if: ${{ (always()) && (github.ref == 'refs/heads/master') }}
needs: [test_wheel_pr]
steps:
- name: Checkout github repo
uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
pattern: results_json-*
merge-multiple: true
path: ./
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
auto-update-conda: true
activate-environment: vega-altair
python-version: '3.10'
- name: Merge the results
shell: bash -el {0}
run: |
git clone https://github.com/OpenGATE/opengate_tests_results.git
cd opengate_tests_results
echo $pwd
ls ..
cp ../dashboard_output_*.json .
conda install -c conda-forge altair-all
pip install pandas numpy
python compile_opengate_tests_results.py
- name: Pushes to another repository
continue-on-error: true
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.PUSH_OPENGATE_TESTS_RESULTS }}
with:
source-directory: 'opengate_tests_results'
destination-github-username: 'OpenGATE'
destination-repository-name: 'opengate_tests_results'
user-email: tbaudier@creatis.insa-lyon.fr
target-branch: master