-
Notifications
You must be signed in to change notification settings - Fork 87
574 lines (473 loc) · 16.9 KB
/
Copy pathbuild.yml
File metadata and controls
574 lines (473 loc) · 16.9 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
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
name: CI
on:
pull_request:
push:
branches:
- main
- 'release/**'
permissions:
contents: read
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39
with:
enable-cache: false
- name: Tidy checks
shell: bash
run: uv run misc/tidy.py --check
build-autoconf:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-15, ubuntu-latest]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39
with:
enable-cache: false
- name: Install Ubuntu build deps
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y flex bison libgmp-dev libmpfr-dev
- name: Install generated-source tools
if: runner.os == 'macOS'
shell: bash
run: |
# The freshness helper bootstraps the pinned Autoconf version itself.
brew install m4 bison flex
- name: Check generated source freshness
if: runner.os == 'macOS'
shell: bash
run: bash .github/ci/generated-source-freshness.sh
- name: Avoid redundant configure regeneration during build
shell: bash
run: touch configure
- name: Configure
shell: bash
run: ./configure
- name: Build
shell: bash
run: make test -j4
- name: Check
shell: bash
run: make check
- name: Autoconf install smoke
shell: bash
run: bash .github/ci/autoconf-install-smoke.sh "$RUNNER_TEMP/gecode-autoconf-install"
- name: Custom VIS dependency smoke
if: runner.os == 'Linux'
shell: bash
run: bash .github/ci/custom-vis-smoke.sh
build-cmake-unix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-15
regenerate_varimp: OFF
- os: ubuntu-latest
regenerate_varimp: ON
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39
with:
enable-cache: false
- name: Install Ubuntu build deps
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y flex bison libgmp-dev libmpfr-dev
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: |
set -euxo pipefail
cmake_args=(
"$GITHUB_WORKSPACE"
"-DCMAKE_BUILD_TYPE=$BUILD_TYPE"
"-DGECODE_REGENERATE_VARIMP=${{ matrix.regenerate_varimp }}"
)
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
# Keep this path absolute to validate package config handling for absolute install dirs.
cmake_args+=(
"-DCMAKE_INSTALL_INCLUDEDIR=/tmp/gecode-install-abs-include"
"-DGECODE_ENABLE_FAULT_INJECTION=ON"
)
fi
cmake "${cmake_args[@]}"
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE
- name: Check
working-directory: ${{github.workspace}}/build
shell: bash
run: |
set -euxo pipefail
cmake --build . --config $BUILD_TYPE --target check
- name: Install CMake package
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --install . --config $BUILD_TYPE --prefix "$GITHUB_WORKSPACE/install"
- name: Consumer smoke tests
shell: bash
run: |
set -euxo pipefail
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
bash .github/ci/cmake-consumer-smoke.sh \
"$GITHUB_WORKSPACE/install" \
"/tmp/gecode-install-abs-include" \
mpfr
else
bash .github/ci/cmake-consumer-smoke.sh \
"$GITHUB_WORKSPACE/install" \
"$GITHUB_WORKSPACE/install/include" \
core
fi
- name: Package version checks
shell: bash
run: bash .github/ci/cmake-package-version-checks.sh "$GITHUB_WORKSPACE/install"
- name: Disabled module closure checks
if: matrix.os == 'ubuntu-latest'
shell: bash
run: bash .github/ci/cmake-closure-checks.sh
- name: CMake custom VIS checks
if: matrix.os == 'ubuntu-latest'
shell: bash
run: bash .github/ci/cmake-custom-vis-smoke.sh
- name: Gist static macro compatibility
if: matrix.os == 'ubuntu-latest'
shell: bash
run: bash .github/ci/gist-static-macro-smoke.sh
- name: Qt minimum version checks
if: matrix.os == 'ubuntu-latest'
shell: bash
run: bash .github/ci/qt-minimum-version-checks.sh
build-cmake-unix-ninja:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39
with:
enable-cache: false
- name: Install build deps
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y flex bison libgmp-dev libmpfr-dev ninja-build
- name: Configure CMake with Ninja
shell: bash
run: >
cmake -S "$GITHUB_WORKSPACE" -B "$GITHUB_WORKSPACE/build-ninja"
-G Ninja
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DGECODE_ENABLE_QT=OFF
-DGECODE_ENABLE_GIST=OFF
-DGECODE_ENABLE_MPFR=OFF
- name: Build
shell: bash
run: cmake --build "$GITHUB_WORKSPACE/build-ninja"
- name: Example feature selection
shell: bash
run: bash .github/ci/cmake-example-feature-smoke.sh
- name: Check
shell: bash
run: >
ctest --test-dir "$GITHUB_WORKSPACE/build-ninja"
--output-on-failure -R '^(build-gecode-test|test)$'
- name: Configure CMake Debug audit smoke
shell: bash
run: >
cmake -S "$GITHUB_WORKSPACE" -B "$GITHUB_WORKSPACE/build-ninja-debug"
-G Ninja
-DCMAKE_BUILD_TYPE=Debug
-DGECODE_ENABLE_AUDIT=ON
-DGECODE_ENABLE_QT=OFF
-DGECODE_ENABLE_GIST=OFF
-DGECODE_ENABLE_MPFR=OFF
-DGECODE_ENABLE_EXAMPLES=OFF
-DGECODE_ENABLE_FLATZINC=OFF
- name: Build Debug audit smoke
shell: bash
run: cmake --build "$GITHUB_WORKSPACE/build-ninja-debug"
- name: Install and smoke test FlatZinc tools
shell: bash
run: |
set -euxo pipefail
cmake --install "$GITHUB_WORKSPACE/build-ninja" --prefix "$GITHUB_WORKSPACE/install-ninja"
bash .github/ci/flatzinc-tools-smoke.sh "$GITHUB_WORKSPACE/install-ninja"
build-32-bit-linkage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Install 32-bit toolchain
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y g++-multilib
- name: Build and link 32-bit stop consumer
shell: bash
run: bash .github/ci/32-bit-linkage-smoke.sh "$GITHUB_WORKSPACE" "$RUNNER_TEMP/gecode-32-bit-linkage"
build-cmake-qt-gist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39
with:
enable-cache: false
- name: Install Qt build deps
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y flex bison qt6-base-dev qt6-base-dev-tools libgl1-mesa-dev
- name: Configure CMake with Qt/Gist
shell: bash
run: >
cmake -S "$GITHUB_WORKSPACE" -B "$GITHUB_WORKSPACE/build-qt-gist"
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DGECODE_ENABLE_QT=ON
-DGECODE_ENABLE_GIST=ON
-DGECODE_ENABLE_MPFR=OFF
-DGECODE_ENABLE_EXAMPLES=OFF
-DGECODE_ENABLE_FLATZINC=ON
- name: Build and install Qt/Gist package
shell: bash
run: |
set -euxo pipefail
cmake --build "$GITHUB_WORKSPACE/build-qt-gist" --config $BUILD_TYPE -j4
cmake --install "$GITHUB_WORKSPACE/build-qt-gist" --config $BUILD_TYPE --prefix "$GITHUB_WORKSPACE/install-qt-gist"
- name: Qt/Gist consumer smoke test
shell: bash
run: bash .github/ci/qt-gist-consumer-smoke.sh "$GITHUB_WORKSPACE/install-qt-gist"
build-cmake-qt5-gist-smoke:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39
with:
enable-cache: false
- name: Install Qt 5 build deps
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y flex bison qtbase5-dev qtbase5-dev-tools libgl1-mesa-dev
- name: Configure CMake with Qt 5/Gist
shell: bash
run: |
set -euxo pipefail
qt5_config="$(dpkg-query -L qtbase5-dev | grep '/Qt5Config.cmake$')"
qt5_dir="${qt5_config%/*}"
cmake -S "$GITHUB_WORKSPACE" -B "$GITHUB_WORKSPACE/build-qt5-gist" \
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
-DQt5_DIR="$qt5_dir" \
-DGECODE_ENABLE_QT=ON \
-DGECODE_ENABLE_GIST=ON \
-DGECODE_ENABLE_MPFR=OFF \
-DGECODE_ENABLE_EXAMPLES=OFF \
-DGECODE_ENABLE_FLATZINC=OFF
grep -Eq '^Qt5_DIR:[^=]*=.*/Qt5$' "$GITHUB_WORKSPACE/build-qt5-gist/CMakeCache.txt"
grep -q '^Qt5Core_DIR:PATH=' "$GITHUB_WORKSPACE/build-qt5-gist/CMakeCache.txt"
- name: Build and install Qt 5/Gist package
shell: bash
run: |
set -euxo pipefail
cmake --build "$GITHUB_WORKSPACE/build-qt5-gist" --config $BUILD_TYPE -j4
cmake --install "$GITHUB_WORKSPACE/build-qt5-gist" --config $BUILD_TYPE --prefix "$GITHUB_WORKSPACE/install-qt5-gist"
- name: Qt 5/Gist consumer smoke test
shell: bash
run: bash .github/ci/qt5-gist-consumer-smoke.sh "$GITHUB_WORKSPACE/install-qt5-gist"
build-cmake-windows:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- name: shared
build_shared: ON
build_static: OFF
- name: static
build_shared: OFF
build_static: ON
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39
with:
enable-cache: false
- name: Create Build Environment
shell: pwsh
run: cmake -E make_directory "${{ github.workspace }}\\build"
- name: Configure CMake
shell: pwsh
run: >
cmake -S "${{ github.workspace }}" -B "${{ github.workspace }}\\build"
-G "Visual Studio 17 2022" -A x64
-DGECODE_ENABLE_QT=OFF
-DGECODE_ENABLE_GIST=OFF
-DGECODE_ENABLE_MPFR=OFF
-DGECODE_BUILD_SHARED=${{ matrix.build_shared }}
-DGECODE_BUILD_STATIC=${{ matrix.build_static }}
- name: Build
shell: pwsh
run: cmake --build "${{ github.workspace }}\\build" --config ${{ env.BUILD_TYPE }}
- name: Check
shell: pwsh
run: cmake --build "${{ github.workspace }}\\build" --config ${{ env.BUILD_TYPE }} --target check
- name: Install CMake package
shell: pwsh
run: cmake --install "${{ github.workspace }}\\build" --config ${{ env.BUILD_TYPE }} --prefix "${{ github.workspace }}\\install"
- name: Consumer smoke tests
shell: pwsh
run: .\.github\ci\cmake-consumer-smoke.ps1 "${{ github.workspace }}\install"
build-cmake-windows-vcpkg:
runs-on: windows-2022
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39
with:
enable-cache: false
- name: Cache vcpkg binary packages
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ${{ runner.temp }}\vcpkg-binary-cache
key: vcpkg-${{ runner.os }}-x64-windows-d015e31e90838a4c9dfa3eed45979bc70d9357fc-${{ hashFiles('vcpkg.json') }}
restore-keys: |
vcpkg-${{ runner.os }}-x64-windows-d015e31e90838a4c9dfa3eed45979bc70d9357fc-
- name: Setup vcpkg
shell: pwsh
run: |
$vcpkgRoot = Join-Path $env:RUNNER_TEMP "vcpkg"
$vcpkgBinaryCache = Join-Path $env:RUNNER_TEMP "vcpkg-binary-cache"
New-Item -ItemType Directory -Force -Path $vcpkgBinaryCache | Out-Null
git clone https://github.com/microsoft/vcpkg $vcpkgRoot
git -C $vcpkgRoot checkout d015e31e90838a4c9dfa3eed45979bc70d9357fc
& (Join-Path $vcpkgRoot "bootstrap-vcpkg.bat") -disableMetrics
"VCPKG_ROOT=$vcpkgRoot" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"VCPKG_DEFAULT_BINARY_CACHE=$vcpkgBinaryCache" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Configure CMake (preset)
shell: pwsh
run: cmake --preset vs2022-vcpkg
- name: Build
shell: pwsh
run: cmake --build --preset vs2022-vcpkg-release
- name: Check
shell: pwsh
run: cmake --build --preset vs2022-vcpkg-check
- name: Install CMake package
shell: pwsh
run: cmake --install "${{ github.workspace }}\\build\\vs2022-vcpkg" --config ${{ env.BUILD_TYPE }} --prefix "${{ github.workspace }}\\install-vcpkg"
- name: Consumer smoke tests
shell: pwsh
run: .\.github\ci\cmake-consumer-smoke-vcpkg.ps1 "${{ github.workspace }}\install-vcpkg"
build-cmake-windows-msys2:
runs-on: windows-2022
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Setup MSYS2
uses: msys2/setup-msys2@e9898307ac31d1a803454791be09ab9973336e1c
with:
msystem: UCRT64
update: true
install: >-
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-ninja
- name: Configure CMake
shell: msys2 {0}
run: |
workspace=$(cygpath -u "$GITHUB_WORKSPACE")
cmake -S "$workspace" -B "$workspace/build-msys2" -G Ninja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DGECODE_ENABLE_QT=OFF \
-DGECODE_ENABLE_GIST=OFF \
-DGECODE_ENABLE_MPFR=OFF \
-DGECODE_BUILD_SHARED=OFF \
-DGECODE_BUILD_STATIC=ON \
-DGECODE_ENABLE_EXAMPLES=OFF \
-DGECODE_ENABLE_FLATZINC=OFF
- name: Build and install static package
shell: msys2 {0}
run: |
workspace=$(cygpath -u "$GITHUB_WORKSPACE")
cmake --build "$workspace/build-msys2"
cmake --install "$workspace/build-msys2" --prefix "$workspace/install-msys2"
- name: Static package consumer smoke
shell: msys2 {0}
run: |
workspace=$(cygpath -u "$GITHUB_WORKSPACE")
bash "$workspace/.github/ci/cmake-consumer-smoke-msys2.sh" "$workspace/install-msys2"
build-autoconf-windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39
with:
enable-cache: false
- name: Resolve uv path on Windows host
shell: pwsh
run: |
$uvExe = (Get-Command uv -ErrorAction Stop).Source
$uvDir = Split-Path -Parent $uvExe
"UV_WIN_DIR=$uvDir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Setup MSYS2
uses: msys2/setup-msys2@e9898307ac31d1a803454791be09ab9973336e1c
with:
msystem: UCRT64
update: true
install: >-
autoconf
automake
bison
flex
gcc
make
m4
libtool
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-gmp
mingw-w64-ucrt-x86_64-mpfr
- name: Verify uv in MSYS2 shell
shell: msys2 {0}
run: |
UV_DIR="$(cygpath "$UV_WIN_DIR")"
echo "UV_DIR=$UV_DIR" >> "$GITHUB_ENV"
export PATH="$UV_DIR:$PATH"
uv --version
- name: Avoid redundant configure regeneration during build
shell: msys2 {0}
run: touch configure
- name: Configure
shell: msys2 {0}
run: |
export PATH="$UV_DIR:$PATH"
CC=gcc CXX=g++ ./configure --with-host-os=Windows --disable-qt --disable-gist --disable-mpfr
- name: Build
shell: msys2 {0}
run: |
export PATH="$UV_DIR:$PATH"
make test -j4
- name: Check
shell: msys2 {0}
run: |
export PATH="$UV_DIR:$PATH"
make check