-
Notifications
You must be signed in to change notification settings - Fork 7
254 lines (220 loc) · 7.68 KB
/
build.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
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
name: Build
on:
push:
branches-ignore:
- gh-pages
schedule:
- cron: '0 0 * * 0'
pull_request:
workflow_dispatch:
jobs:
debug:
name: 'Test & Debug (Linux)'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.4.0'
target: 'desktop'
cached: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libgl1-mesa-dev libxkbcommon-x11-0 libxcb-icccm4 libxcb-xinerama0 libxcb-xkb1 libxcb-render-util0 libxcb-keysyms1 libxcb-image0 gcovr
- name: Configure
run: cmake -GNinja -DVIPSTER_DESKTOP=ON -DPython3_ROOT_DIR=${pythonLocation} -DVIPSTER_PYWIDGET=ON -DVIPSTER_LAMMPS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage" -B build
- name: Build
run: cmake --build build
- name: Test
run: |
cd build
ctest --output-on-failure
- name: Generate XML Coverage
run: gcovr -f vipster -x -o coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage.xml
release:
name: 'Build @ ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
script: make-appimage.sh
artifact: Vipster-Linux-x86_64.AppImage
qt_arch: gcc_64
- os: windows-latest
script: make-win-archive.sh
artifact: Vipster-Win-x86_64.zip
qt_arch: win64_mingw
#- os: macOS-latest
# script: make-macos-app.sh
# artifact: Vipster-macOS-x86_64.dmg
# qt_arch: clang_64
needs: debug
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Add Python libraries
shell: bash
run: pip install numpy moltemplate
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.4.0'
target: 'desktop'
arch: ${{ matrix.qt_arch }}
dir: ${{ github.workspace }}
cached: true
- name: Cache MinGW
if: runner.os == 'Windows'
id: cache-mingw
uses: actions/cache@v3
with:
path: MinGW
key: mingw-18.0
- name: Install MinGW
if: (runner.os == 'Windows') && (steps.cache-mingw.outputs.cache-hit != 'true')
shell: bash
run: |
choco install wget -y --no-progress
wget https://nuwen.net/files/mingw/mingw-18.0-without-git.exe
7z x mingw-18.0-without-git.exe
MinGW/set_distro_paths.bat
- name: Configure MinGW
if: runner.os == 'Windows'
shell: bash
run: |
echo $GITHUB_WORKSPACE/MinGW/bin >> $GITHUB_PATH
echo CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/MinGW:$CMAKE_PREFIX_PATH >> $GITHUB_ENV
- name: Configure Linux
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install libgl1-mesa-dev libxkbcommon-x11-0 libxcb-icccm4 libxcb-xinerama0 libxcb-xkb1 libxcb-render-util0 libxcb-keysyms1 libxcb-image0
- name: Configure
shell: bash
run: cmake -GNinja -DVIPSTER_DESKTOP=ON -DPython3_ROOT_DIR=${pythonLocation} -DVIPSTER_PYWIDGET=ON -DVIPSTER_LAMMPS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -B build
- name: Build
shell: bash
run: cmake --build build
- name: Test
shell: bash
run: |
cd build
ctest --output-on-failure
- name: Bundle artifact
shell: bash
run: |
cd build
. ../util/${{ matrix.script }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Vipster-${{ runner.os }}
path: build/${{ matrix.artifact }}
web:
name: 'WebVipster'
runs-on: ubuntu-latest
needs: debug
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: mymindstorm/setup-emsdk@v7
with:
version: latest
- name: Build
run: npm run prepare
- name: Bundle artifact
run: |
ARTIFACT=$(npm pack | tail -1)
echo "ARTIFACT=$ARTIFACT" >> $GITHUB_ENV
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Vipster-Web
path: ${{ env.ARTIFACT }}
wheels:
name: 'Python Wheels'
runs-on: ${{ matrix.os }}
needs: [release, web]
strategy:
matrix:
os: [windows-latest, ubuntu-20.04]
python-version: ['3.8', '3.9', '3.10', '3.11']
include:
- os: windows-latest
wheeldir: dist
- os: ubuntu-20.04
wheeldir: wheelhouse
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Cache MinGW
if: runner.os == 'Windows'
id: cache-mingw
uses: actions/cache@v3
with:
path: MinGW
key: mingw-18.0
- name: Install MinGW
if: (runner.os == 'Windows') && (steps.cache-mingw.outputs.cache-hit != 'true')
shell: bash
run: |
choco install wget -y --no-progress
wget https://nuwen.net/files/mingw/mingw-18.0-without-git.exe
7z x mingw-18.0-without-git.exe
MinGW/set_distro_paths.bat
- name: Configure MinGW
if: runner.os == 'Windows'
shell: bash
run: |
echo $GITHUB_WORKSPACE/MinGW/bin >> $GITHUB_PATH
echo CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/MinGW:$CMAKE_PREFIX_PATH >> $GITHUB_ENV
echo CMAKE_GENERATOR="MSYS Makefiles" >> $GITHUB_ENV
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Build wheel
shell: bash
run: |
pip install setuptools wheel cmake
python setup.py bdist_wheel
- name: Fix Manylinux
if: runner.os == 'Linux'
shell: bash
run: |
pip install auditwheel==5.1.2
auditwheel repair dist/*.whl --plat manylinux_2_31_x86_64
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Vipster-PyWheel-${{ runner.os }}
path: ${{ matrix.wheeldir }}/*.whl