-
Notifications
You must be signed in to change notification settings - Fork 7
205 lines (172 loc) · 5.94 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
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-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.8.0'
target: 'desktop'
cache: 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 libxcb-cursor0 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-22.04
script: make-appimage.sh
artifact: Vipster-Linux-x86_64.AppImage
qt_arch: linux_gcc_64
- os: windows-latest
script: make-win-archive.sh
artifact: Vipster-Win-x86_64.zip
qt_arch: win64_msvc2022_64
#- os: macOS-latest
# script: make-macos-app.sh
# artifact: Vipster-macOS-x86_64.dmg
# qt_arch: clang_64
needs: debug
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ilammy/msvc-dev-cmd@v1
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Add Python libraries
run: pip install numpy moltemplate
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.8.0'
target: 'desktop'
arch: ${{ matrix.qt_arch }}
dir: ${{ github.workspace }}
cache: true
- name: Configure Linux
if: runner.os == 'Linux'
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 libxcb-cursor0 fuse
- name: Configure
shell: bash
run: cmake -GNinja -DVIPSTER_DESKTOP=ON -DPython3_ROOT_DIR=pythonLocation -DVIPSTER_PYWIDGET=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -B build
- name: Build
run: cmake --build build
- name: Test
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@v4
with:
name: Vipster-${{ runner.os }}
path: build/${{ matrix.artifact }}
web:
name: 'WebVipster'
runs-on: ubuntu-latest
needs: debug
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- uses: mymindstorm/setup-emsdk@v14
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@v4
with:
name: Vipster-Web
path: ${{ env.ARTIFACT }}
wheels:
name: 'Python Wheels'
runs-on: ${{ matrix.os }}
needs: [release, web]
strategy:
matrix:
os: [windows-latest, ubuntu-22.04]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
include:
- os: windows-latest
wheeldir: dist
- os: ubuntu-22.04
wheeldir: wheelhouse
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build wheel
run: |
pip install setuptools wheel cmake
python setup.py bdist_wheel
- name: Fix Manylinux
if: runner.os == 'Linux'
run: |
pip install auditwheel
auditwheel repair dist/*.whl --plat manylinux_2_35_x86_64
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Vipster-Python-${{ matrix.python-version }}-${{ runner.os }}
path: ${{ matrix.wheeldir }}/*.whl