-
Notifications
You must be signed in to change notification settings - Fork 17
252 lines (226 loc) · 8.69 KB
/
windows.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
name: Windows
on:
pull_request:
branches:
- master
schedule:
# Runs every day at 23:15
- cron: '15 23 * * *'
jobs:
build:
name: Building with ${{ matrix.sofa_version }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
sofa_version: [ master ]
include:
- sofa_version: master
PYTHON_VERSION: 3.8
EIGEN_VERSION: 3.4
PYBIND11_VERSION: 2.4.3
# - sofa_version: v21.12.00
# PYTHON_VERSION: 3.7
# EIGEN_VERSION: 3.3.7
# PYBIND11_VERSION: 2.4.3
env:
SOFA_VERSION: ${{ matrix.sofa_version }}
SOFA_ROOT: ${{ format('{0}/sofa', github.workspace) }}
PYBIND11_ROOT: ${{ format('{0}/pybind11', github.workspace) }}
PYBIND11_VERSION: ${{ matrix.PYBIND11_VERSION }}
QT_ROOT: ${{ format('{0}/qt', github.workspace) }}
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
BOOST_ROOT: ${{ format('{0}/boost', github.workspace) }}
EIGEN_ROOT: ${{ format('{0}/eigen', github.workspace) }}
EIGEN_VERSION: ${{ matrix.EIGEN_VERSION }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: |
git config --global user.email "caribou@github.com"
git config --global user.name "Caribou Github"
git fetch origin
git merge origin/master
# Python
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.PYTHON_VERSION }}
# Eigen3
- name: cache eigen
uses: actions/cache@v2
id: cache-eigen
with:
path: ${{ github.workspace }}/eigen
key: eigen-${{ matrix.EIGEN_VERSION }}-windows
- name: Install Eigen
if: steps.cache-eigen.outputs.cache-hit != 'true'
shell: bash
run: |
git clone --depth 1 -b $EIGEN_VERSION https://gitlab.com/libeigen/eigen.git eigen_src
cmake -S eigen_src -B eigen_src/build -DCMAKE_BUILD_TYPE=Release -DEIGEN_BUILD_DOC=OFF -DCMAKE_INSTALL_PREFIX="$EIGEN_ROOT"
cmake --build eigen_src/build --target install
# PYBIND11
- name: Install pybind11
shell: bash
run: |
git clone --depth 1 -b v$PYBIND11_VERSION https://github.com/pybind/pybind11.git pybind11_src
cmake -S pybind11_src -B pybind11_src/build -DPYBIND11_TEST=OFF -DCMAKE_BUILD_TYPE=Release -DPYBIND11_FINDPYTHON=ON
cmake --install pybind11_src/build --prefix $PYBIND11_ROOT
rm -rf pybind11_src
# BOOST
- name: Cache Boost
id: cache-Boost
uses: actions/cache@v1
with:
path: ${{ format('{0}/boost', github.workspace) }}
key: boost-1.69.0-windows
- name: Install Boost
if: steps.cache-Boost.outputs.cache-hit != 'true'
run: |
$BOOST_MAJOR = 1
$BOOST_MINOR = 69
$BOOST_PATCH = 0
Invoke-WebRequest "https://boost.teeks99.com/bin/$($BOOST_MAJOR).$($BOOST_MINOR).$($BOOST_PATCH)/boost_$($BOOST_MAJOR)_$($BOOST_MINOR)_$($BOOST_PATCH)-msvc-14.1-64.exe" -OutFile boostinstaller.exe
./boostinstaller.exe /NORESTART /VERYSILENT /DIR="$($BOOST_ROOT)" | Out-Null
rm -Force boostinstaller.exe
# SOFA
- name: Download SOFA Release
shell: bash
run: |
if [ "$SOFA_VERSION" = "master" ]; then
curl --output sofa.zip -L "https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=master,CI_SCOPE=standard/lastSuccessfulBuild/artifact/Windows/*zip*/Windows.zip"
unzip sofa.zip -d temp
mv temp/Windows/`ls temp/Windows` sofa.zip
rm -rf temp
unzip sofa.zip -d temp
mv temp/`ls temp` $SOFA_ROOT
rm -rf temp
else
curl --output sofa.zip -L "https://github.com/sofa-framework/sofa/releases/download/$SOFA_VERSION/SOFA_"$SOFA_VERSION"_Win64.zip"
unzip sofa.zip -d temp
mv temp/`ls temp` $SOFA_ROOT
fi
# Patch SP3 absolute path
sed -i 's/C:\/pybind11\/[0-9].[0-9].[0-9]\/install\/include;//' $SOFA_ROOT/plugins/SofaPython3/lib/cmake/SofaPython3/PluginTargets.cmake
# SOFA DEPENDENCY PACK
- name: Download SOFA Dependency pack
shell: bash
run: |
curl --output sofa_dependency.zip -L "https://www.sofa-framework.org/download/WinDepPack/VS-2017/latest"
unzip sofa_dependency.zip -d temp
mv temp/`ls temp` $SOFA_ROOT/windows_dependency
rm -rf temp
# QT
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ${{ format('{0}/qt', github.workspace) }}
key: qt-5.12.6-windows
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: '5.12.6'
dir: ${{ format('{0}/qt', github.workspace) }}
cached: ${{ steps.cache-qt.outputs.cache-hit }}
modules: 'qtcharts qtwebengine'
# CARIBOU
- name: Build caribou
shell: bash
run:
cmake -DCMAKE_BUILD_TYPE=Release
-Dpybind11_DIR=$PYBIND11_ROOT
-DEigen3_ROOT=$EIGEN_ROOT
-DCMAKE_INCLUDE_PATH=$SOFA_ROOT/windows_dependency/include
-DCMAKE_LIBRARY_PATH=$SOFA_ROOT/windows_dependency/lib/win64
-DQt5_ROOT=$QT_ROOT\5.12.5\msvc2017_64
-DCMAKE_INSTALL_PREFIX=$SOFA_ROOT/plugins/SofaCaribou
-DCMAKE_PREFIX_PATH=$SOFA_ROOT/lib/cmake
-DCARIBOU_WITH_PYTHON_3=OFF
.
&& cmake --build . --config Release
&& cmake --install .
# ZIP
- name: Zip production
run: Compress-Archive -LiteralPath "$($env:SOFA_ROOT)/plugins/SofaCaribou" -DestinationPath SofaCaribou.zip
# ARCHIVE
- name: Archive production
uses: actions/upload-artifact@v4.4.0
with:
name: caribou_win64_${{ matrix.sofa_version }}
path: SofaCaribou.zip
test:
name: Testing with ${{ matrix.sofa_version }}
needs: [build]
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
sofa_version: [ master ]
include:
- sofa_version: master
PYTHON_VERSION: 3.8.10
# - sofa_version: v21.12.00
# PYTHON_VERSION: 3.7
env:
SOFA_VERSION: ${{ matrix.sofa_version }}
SOFA_ROOT: ${{ format('{0}\sofa', github.workspace) }}
CARIBOU_ROOT: ${{ format('{0}\sofa\plugins\SofaCaribou', github.workspace) }}
steps:
# Python
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.PYTHON_VERSION }}
# PATH
- run: echo "${$env:SOFA_ROOT}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# SOFA
- name: Download SOFA Release
shell: bash
run: |
if [ "$SOFA_VERSION" = "master" ]; then
curl --output sofa.zip -L "https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=master,CI_SCOPE=standard/lastSuccessfulBuild/artifact/Windows/*zip*/Windows.zip"
unzip sofa.zip -d temp
mv temp/Windows/`ls temp/Windows` sofa.zip
rm -rf temp
unzip sofa.zip -d temp
mv temp/`ls temp` $SOFA_ROOT
rm -rf temp
else
curl --output sofa.zip -L "https://github.com/sofa-framework/sofa/releases/download/$SOFA_VERSION/SOFA_"$SOFA_VERSION"_Win64.zip"
unzip sofa.zip -d temp
mv temp/`ls temp` $SOFA_ROOT
fi
# CARIBOU
- name: Download caribou
uses: actions/download-artifact@v4.1.7
with:
name: caribou_win64_${{ matrix.sofa_version }}
- name: Install caribou
run: Expand-Archive -Path SofaCaribou.zip -DestinationPath "${$env:SOFA_ROOT}\plugins"
- name: Caribou.unittests.Geometry
if: ${{ always() }}
shell: bash
run: |
export PATH="$SOFA_ROOT/bin:$PATH"
$CARIBOU_ROOT/bin/Caribou.unittests.Geometry.exe
- name: Caribou.unittests.Topology
if: ${{ always() }}
shell: bash
run: |
export PATH="$SOFA_ROOT/bin:$PATH"
$CARIBOU_ROOT/bin/Caribou.unittests.Topology.exe
- name: Caribou.unittests.Mechanics
if: ${{ always() }}
shell: bash
run: |
export PATH="$SOFA_ROOT/bin:$PATH"
$CARIBOU_ROOT/bin/Caribou.unittests.Mechanics.exe
- name: Caribou.unittests.SofaCaribou
if: ${{ always() }}
shell: bash
run: |
export PATH="$SOFA_ROOT/bin:$PATH"
$CARIBOU_ROOT/bin/Caribou.unittests.SofaCaribou.exe