-
Notifications
You must be signed in to change notification settings - Fork 39
387 lines (368 loc) · 15 KB
/
Copy pathci.yml
File metadata and controls
387 lines (368 loc) · 15 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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
name: Continuous Integration
on: [push]
jobs:
finish-ci:
runs-on: ubuntu-latest
needs: [build-macos, build-linux, build-windows, build-msys-openmodelica, build-msys, build-docs]
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v5
with:
pattern: binaries-*
merge-multiple: true
- name: Determine the name suffix
id: ref_name
run: |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
echo "This is a tag build"
echo "ref_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "This is a branch build"
echo "ref_name=latest" >> $GITHUB_OUTPUT
fi
- name: Copy the PDF manual
run: cp ExternalMedia/Resources/manual.pdf ExternalMedia-${{ steps.ref_name.outputs.ref_name }}.pdf
- name: Zip binaries
uses: papeloto/action-zip@v1
with:
files: ExternalMedia/
recursive: true
dest: ExternalMedia-${{ steps.ref_name.outputs.ref_name }}.zip
- name: Display the file structure
run: ls -R
- name: Upload zipped binaries
uses: actions/upload-artifact@v5
with:
name: ExternalMedia-binaries
path: |
./ExternalMedia-latest.pdf
./ExternalMedia-latest.zip
if: github.ref_type != 'tag'
- name: Release on GitHub
uses: softprops/action-gh-release@v2
with:
files: |
./ExternalMedia-*.pdf
./ExternalMedia-*.zip
if: github.ref_type == 'tag'
- uses: geekyeggo/delete-artifact@v5
with:
name: binaries-*
get-coolprop:
runs-on: ubuntu-latest
outputs:
coolprop-hash: ${{ steps.coolprop_hash.outputs.coolprop-hash }}
coolprop-check: ${{ steps.coolprop_check.outputs.coolprop-check }}
env:
COOLPROP_VERSION: v7.2.0
steps:
- name: Get CoolProp version hash
shell: bash
id: coolprop_hash
run: echo "coolprop-hash=$(git ls-remote https://github.com/CoolProp/CoolProp.git refs/tags/${COOLPROP_VERSION} | awk '{print $1}')" >> $GITHUB_OUTPUT
- name: Restore the CoolProp cache
uses: actions/cache/restore@v4
id: coolprop_cache
with:
key: coolprop-${{ steps.coolprop_hash.outputs.coolprop-hash }}
path: externals/CoolProp.git
lookup-only: true
enableCrossOsArchive: true
- name: Download CoolProp sources
if: steps.coolprop_cache.outputs.cache-hit != 'true'
shell: bash
run: |
mkdir externals
cd externals
git clone --recursive https://github.com/CoolProp/CoolProp.git CoolProp.git
cd CoolProp.git
git checkout tags/${COOLPROP_VERSION}
git submodule update --init --recursive
- name: Save the CoolProp cache
uses: actions/cache/save@v4
if: steps.coolprop_cache.outputs.cache-hit != 'true'
with:
key: coolprop-${{ steps.coolprop_hash.outputs.coolprop-hash }}
path: externals/CoolProp.git
enableCrossOsArchive: true
- name: Set CoolProp availability
id: coolprop_check
shell: bash
run: |
if [ "${{ steps.coolprop_cache.outputs.cache-hit }}" = "true" ]; then
echo "CoolProp exists in the cache"
echo "coolprop-check=1" >> $GITHUB_OUTPUT
else
if [ -d "externals/CoolProp.git" ]; then
echo "CoolProp has been cloned successfully"
echo "coolprop-check=1" >> $GITHUB_OUTPUT
else
echo "CoolProp is NOT available"
echo "coolprop-check=0" >> $GITHUB_OUTPUT
fi
fi
build-macos:
needs: get-coolprop
runs-on: ${{ matrix.platform }}
strategy:
# Only use one build here, otherwise we cannot control which build is included in the release zip package
# Check the use of the ${MODELICA_PLATFORM} and ${MODELICA_COMPILER} variables in the CMake files
matrix:
include:
- platform: macos-latest # currently macos-26, arm-only
arch: arm64
- platform: macos-15-intel
arch: x86_64
steps:
- uses: actions/checkout@v5
- name: Create Build Environment
run: |
cmake --version
cmake -E make_directory ${{runner.workspace}}/build
- name: Restore CoolProp sources
if: needs.get-coolprop.outputs.coolprop-check == '1'
uses: actions/cache/restore@v4
with:
key: coolprop-${{ needs.get-coolprop.outputs.coolprop-hash }}
path: externals/CoolProp.git
fail-on-cache-miss: true
enableCrossOsArchive: true
- name: Configure with CMake
working-directory: ${{runner.workspace}}/build
run: |
cmake ${GITHUB_WORKSPACE}/Projects -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} -DFLUIDPROP=0 -DCOOLPROP=${{ needs.get-coolprop.outputs.coolprop-check }} || true
cmake ${GITHUB_WORKSPACE}/Projects -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} -DFLUIDPROP=0 -DCOOLPROP=${{ needs.get-coolprop.outputs.coolprop-check }}
- name: Build with CMake
working-directory: ${{runner.workspace}}/build
run: cmake --build . --target ExternalMediaLib
- name: Install with CMake
working-directory: ${{runner.workspace}}/build
run: cmake --build . --target install
- name: upload macos artifacts
uses: actions/upload-artifact@v4
with:
name: binaries-macos-${{ matrix.arch }}
path: Modelica
build-linux:
needs: get-coolprop
runs-on: ${{ matrix.platform }}
strategy:
# Only use one build here, otherwise we cannot control which build is included in the release zip package
# Check the use of the ${MODELICA_PLATFORM} and ${MODELICA_COMPILER} variables in the CMake files
matrix:
include:
- platform: ubuntu-latest
#- platform: ubuntu-20.04
#- platform: ubuntu-18.04
steps:
- uses: actions/checkout@v5
- name: Create Build Environment
run: |
cmake --version
cmake -E make_directory ${{runner.workspace}}/build
- name: Restore CoolProp sources
if: needs.get-coolprop.outputs.coolprop-check == '1'
uses: actions/cache/restore@v4
with:
key: coolprop-${{ needs.get-coolprop.outputs.coolprop-hash }}
path: externals/CoolProp.git
fail-on-cache-miss: true
enableCrossOsArchive: true
- name: Configure with CMake
working-directory: ${{runner.workspace}}/build
run: |
cmake ${GITHUB_WORKSPACE}/Projects -DCMAKE_BUILD_TYPE=Release -DFLUIDPROP=0 -DCOOLPROP=${{ needs.get-coolprop.outputs.coolprop-check }} || true
cmake ${GITHUB_WORKSPACE}/Projects -DCMAKE_BUILD_TYPE=Release -DFLUIDPROP=0 -DCOOLPROP=${{ needs.get-coolprop.outputs.coolprop-check }}
- name: Build with CMake
working-directory: ${{runner.workspace}}/build
run: cmake --build . --target ExternalMediaLib
- name: Install with CMake
working-directory: ${{runner.workspace}}/build
run: cmake --build . --target install
- name: upload linux artifacts
uses: actions/upload-artifact@v4
with:
name: binaries-linux-x86_64
path: Modelica
build-windows:
needs: get-coolprop
runs-on: ${{ matrix.platform }}
strategy:
# Use several builds here, Windows requires different builds for different compilers
# Check the use of the ${MODELICA_PLATFORM} and ${MODELICA_COMPILER} variables in the CMake files
matrix:
include:
- platform: windows-2025
generator: Visual Studio 17 2022
arch: Win32
toolset: v143
- platform: windows-2025
generator: Visual Studio 17 2022
arch: x64
toolset: v143
steps:
- uses: actions/checkout@v5
- name: Restore CoolProp sources
if: needs.get-coolprop.outputs.coolprop-check == '1'
uses: actions/cache/restore@v4
with:
key: coolprop-${{ needs.get-coolprop.outputs.coolprop-hash }}
path: externals/CoolProp.git
fail-on-cache-miss: true
enableCrossOsArchive: true
- name: Create Build Environment
run: |
cmake --version
cmake -E make_directory ${{runner.workspace}}/build
- name: Configure with CMake
working-directory: ${{runner.workspace}}/build
run: |
cmake ${{ runner.workspace }}/ExternalMedia/Projects -A ${{ matrix.arch }} -G "${{ matrix.generator }}" -T "${{ matrix.toolset }}" -DFLUIDPROP=1 -DCOOLPROP=${{ needs.get-coolprop.outputs.coolprop-check }}
cmake ${{ runner.workspace }}/ExternalMedia/Projects -A ${{ matrix.arch }} -G "${{ matrix.generator }}" -T "${{ matrix.toolset }}" -DFLUIDPROP=1 -DCOOLPROP=${{ needs.get-coolprop.outputs.coolprop-check }}
- name: Build with CMake
working-directory: ${{runner.workspace}}/build
run: cmake --build . --target ExternalMediaLib --config Release
- name: Install with CMake
working-directory: ${{runner.workspace}}/build
run: cmake --build . --target install --config Release
- name: upload windows artifacts
uses: actions/upload-artifact@v4
with:
name: binaries-windows-${{ matrix.toolset }}-${{ matrix.arch }}
path: Modelica
get-msys-openmodelica:
runs-on: windows-latest
outputs:
omdev-hash: ${{ steps.keyomdev.outputs.omdev-hash }}
steps:
- name: Get OMDev version hash
shell: bash
id: keyomdev
run: echo "omdev-hash=$(git ls-remote https://openmodelica.org/git/OMDev.git HEAD | awk '{print $1}')" >> $GITHUB_OUTPUT
- name: Restore the OMDev cache
uses: actions/cache/restore@v4
id: cacheomdev
with:
path: C:/OMDev
key: omdev-${{ steps.keyomdev.outputs.omdev-hash }}
lookup-only: true
- name: Create the OMDev environment
if: steps.cacheomdev.outputs.cache-hit != 'true'
run: git clone https://openmodelica.org/git/OMDev.git C:/OMDev
- name: Save the OMDev cache
uses: actions/cache/save@v4
if: steps.cacheomdev.outputs.cache-hit != 'true'
with:
path: C:/OMDev
key: omdev-${{ steps.keyomdev.outputs.omdev-hash }}
build-msys-openmodelica:
needs: [get-msys-openmodelica, get-coolprop]
runs-on: windows-latest
strategy:
matrix:
include:
- bitness: 32
- bitness: 64
steps:
- name: Restore the OMDev cache
uses: actions/cache/restore@v4
id: cache-omdev
with:
path: C:/OMDev
key: omdev-${{ needs.get-msys-openmodelica.outputs.omdev-hash }}
- uses: actions/checkout@v5
- name: Restore CoolProp sources
if: needs.get-coolprop.outputs.coolprop-check == '1'
uses: actions/cache/restore@v4
with:
key: coolprop-${{ needs.get-coolprop.outputs.coolprop-hash }}
path: externals/CoolProp.git
fail-on-cache-miss: true
enableCrossOsArchive: true
- name: Configure with CMake for ${{ matrix.bitness }}bit
working-directory: ${{runner.workspace}}
run: |
$env:Path = "${env:ProgramFiles}\CMake\bin;C:\OMDev\tools\msys\usr\bin;C:\OMDev\tools\msys\mingw${{ matrix.bitness }}\bin;$env:Path"
cmake -B build -S ${{ runner.workspace }}/ExternalMedia/Projects -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLUIDPROP=1 -DCOOLPROP=${{ needs.get-coolprop.outputs.coolprop-check }}
cmake -B build -S ${{ runner.workspace }}/ExternalMedia/Projects -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLUIDPROP=1 -DCOOLPROP=${{ needs.get-coolprop.outputs.coolprop-check }}
- name: Build with CMake for ${{ matrix.bitness }}bit
working-directory: ${{runner.workspace}}
run: |
$env:Path = "${env:ProgramFiles}\CMake\bin;C:\OMDev\tools\msys\usr\bin;C:\OMDev\tools\msys\mingw${{ matrix.bitness }}\bin;$env:Path"
cmake --build build --target ExternalMediaLib
cmake --build build --target install
- name: upload msys-openmodelica artifacts
uses: actions/upload-artifact@v4
with:
name: binaries-windows-msys-openmodelica-${{ matrix.bitness }}
path: Modelica
build-msys:
needs: get-coolprop
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Restore CoolProp sources
if: needs.get-coolprop.outputs.coolprop-check == '1'
uses: actions/cache/restore@v4
with:
key: coolprop-${{ needs.get-coolprop.outputs.coolprop-hash }}
path: externals/CoolProp.git
fail-on-cache-miss: true
enableCrossOsArchive: true
- name: Create Build Environment
run: |
cmake --version
cmake -E make_directory ${{runner.workspace}}/build
- name: Configure with CMake
working-directory: ${{runner.workspace}}/build
run: |
cmake ${{ runner.workspace }}/ExternalMedia/Projects -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLUIDPROP=1 -DCOOLPROP=${{ needs.get-coolprop.outputs.coolprop-check }}
cmake ${{ runner.workspace }}/ExternalMedia/Projects -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLUIDPROP=1 -DCOOLPROP=${{ needs.get-coolprop.outputs.coolprop-check }}
- name: Build with CMake
working-directory: ${{runner.workspace}}/build
run: cmake --build . --target ExternalMediaLib
- name: Install with CMake
working-directory: ${{runner.workspace}}/build
run: cmake --build . --target install
#- name: upload msys artifacts
# uses: actions/upload-artifact@v4
# with:
# name: binaries-msys
# path: Modelica
build-docs:
needs: get-coolprop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Restore CoolProp sources
if: needs.get-coolprop.outputs.coolprop-check == '1'
uses: actions/cache/restore@v4
with:
key: coolprop-${{ needs.get-coolprop.outputs.coolprop-hash }}
path: externals/CoolProp.git
fail-on-cache-miss: true
enableCrossOsArchive: true
- name: Build Doxygen sources
uses: mattnotmitt/doxygen-action@v1
with:
working-directory: 'Projects/'
doxyfile-path: './Doxyfile'
enable-latex: true
- name: Upload documentation artifacts
uses: actions/upload-artifact@v4
with:
name: docs
path: Projects/Documentation
- name: Copy PDF to Modelica tree
run: cp 'Projects/Documentation/latex/refman.pdf' 'Modelica/ExternalMedia/Resources/manual.pdf'
- name: Upload Modelica sources with PDF
uses: actions/upload-artifact@v4
with:
name: binaries-docs
path: Modelica
- name: Deploy generated HTML
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: Projects/Documentation/html
#destination_dir: latest