|
25 | 25 | options: "-DENABLE_TESTS=ON", |
26 | 26 | packager: "sudo apt-get", |
27 | 27 | # no expect because stdout seems to be redirected |
28 | | - packages: "libcmocka-dev libxxhash-dev shunit2", |
| 28 | + packages: "libcmocka-dev libxxhash-dev", |
29 | 29 | snaps: "", |
30 | 30 | build-cmd: "make" |
31 | 31 | } |
|
36 | 36 | cc: "clang", |
37 | 37 | options: "-DENABLE_TESTS=ON", |
38 | 38 | packager: "sudo apt-get", |
39 | | - packages: "libcmocka-dev libxxhash-dev shunit2", |
| 39 | + packages: "libcmocka-dev libxxhash-dev", |
40 | 40 | snaps: "", |
41 | 41 | build-cmd: "make" |
42 | 42 | } |
|
47 | 47 | cc: "gcc", |
48 | 48 | options: "", |
49 | 49 | packager: "sudo apt-get", |
50 | | - packages: "libcmocka-dev libxxhash-dev valgrind shunit2", |
| 50 | + packages: "libcmocka-dev libxxhash-dev valgrind", |
51 | 51 | snaps: "", |
52 | 52 | build-cmd: "make" |
53 | 53 | } |
|
59 | 59 | options: "", |
60 | 60 | packager: "sudo apt-get", |
61 | 61 | # no valgrind because it does not support DWARF5 yet generated by clang 14 |
62 | | - packages: "libcmocka-dev libxxhash-dev shunit2", |
| 62 | + packages: "libcmocka-dev libxxhash-dev", |
63 | 63 | snaps: "", |
64 | 64 | build-cmd: "make" |
65 | 65 | } |
|
70 | 70 | cc: "clang", |
71 | 71 | options: "-DENABLE_TESTS=ON -DPATH_EXPECT=", |
72 | 72 | packager: "brew", |
73 | | - packages: "cmocka xxhash shunit2 tcl-tk", |
| 73 | + packages: "cmocka xxhash tcl-tk", |
74 | 74 | snaps: "", |
75 | 75 | build-cmd: "make" |
76 | 76 | } |
@@ -241,3 +241,144 @@ jobs: |
241 | 241 | - name: Install |
242 | 242 | working-directory: '${{ github.workspace }}/../build' |
243 | 243 | run: cmake --install . --strip |
| 244 | + |
| 245 | + build-solaris: |
| 246 | + name: Release, Solaris, gcc |
| 247 | + runs-on: ubuntu-latest |
| 248 | + steps: |
| 249 | + - uses: actions/checkout@v4 |
| 250 | + |
| 251 | + - name: Build and test |
| 252 | + uses: vmactions/solaris-vm@v1 |
| 253 | + with: |
| 254 | + release: '11.4-gcc' |
| 255 | + usesh: true |
| 256 | + |
| 257 | + run: | |
| 258 | + set -x |
| 259 | + set -e |
| 260 | +
|
| 261 | + echo "--- SETUP ENVIRONMENT ---" |
| 262 | + # update PATH for the current user so 'git' and 'cmake' work later |
| 263 | + export PATH=/opt/csw/bin:$PATH |
| 264 | +
|
| 265 | + # update package catalog and install dependencies |
| 266 | + echo "Installing dependencies..." |
| 267 | + sudo /opt/csw/bin/pkgutil -U |
| 268 | + sudo /opt/csw/bin/pkgutil -y -i git cmake libpcre2_dev |
| 269 | +
|
| 270 | + echo "--- BUILD CMOCKA ---" |
| 271 | + if [ ! -d "cmocka" ]; then |
| 272 | + git clone --depth 1 https://github.com/clibs/cmocka.git |
| 273 | + fi |
| 274 | +
|
| 275 | + cd cmocka |
| 276 | + rm -rf build-cmocka && mkdir build-cmocka |
| 277 | + cd build-cmocka |
| 278 | +
|
| 279 | + # CMake is now in PATH because of the export above |
| 280 | + cmake -DCMAKE_INSTALL_PREFIX=$HOME/local -DCMAKE_BUILD_TYPE=Release .. |
| 281 | + cmake --build . |
| 282 | + cmake --install . |
| 283 | + cd ../.. |
| 284 | +
|
| 285 | + echo "--- BUILD LIBYANG ---" |
| 286 | + mkdir -p build |
| 287 | + cd build |
| 288 | +
|
| 289 | + cmake -DCMAKE_BUILD_TYPE=Release \ |
| 290 | + -DENABLE_TESTS=ON \ |
| 291 | + -DCMAKE_PREFIX_PATH="$HOME/local;/opt/csw" \ |
| 292 | + .. |
| 293 | +
|
| 294 | + cmake --build . |
| 295 | + ctest --output-on-failure |
| 296 | +
|
| 297 | + build-freebsd: |
| 298 | + name: Release, FreeBSD, clang |
| 299 | + runs-on: ubuntu-latest |
| 300 | + steps: |
| 301 | + - uses: actions/checkout@v4 |
| 302 | + |
| 303 | + - name: Release, FreeBSD, clang |
| 304 | + uses: vmactions/freebsd-vm@v1 |
| 305 | + with: |
| 306 | + usesh: true |
| 307 | + |
| 308 | + run: | |
| 309 | + set -x # Show commands |
| 310 | + set -e # Stop on error |
| 311 | +
|
| 312 | + # 1. CLEANUP HOST ARTIFACTS |
| 313 | + echo "Cleaning up Linux artifacts..." |
| 314 | + rm -rf build |
| 315 | +
|
| 316 | + # 2. INSTALL DEPENDENCIES |
| 317 | + echo "Installing dependencies..." |
| 318 | + # Clean the pkg database to avoid issues with cached packages |
| 319 | + rm -f /var/db/pkg/local.sqlite |
| 320 | + pkg update -f |
| 321 | + pkg install -y cmake cmocka xxhash bash git |
| 322 | +
|
| 323 | + # 3. BUILD |
| 324 | + echo "Starting Build..." |
| 325 | + mkdir build |
| 326 | + cd build |
| 327 | +
|
| 328 | + cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=ON .. |
| 329 | + cmake --build . |
| 330 | + ctest --output-on-failure |
| 331 | +
|
| 332 | + build-linux-32bit: |
| 333 | + name: Release, Linux 32-bit, gcc |
| 334 | + runs-on: ubuntu-latest |
| 335 | + steps: |
| 336 | + - uses: actions/checkout@v4 |
| 337 | + |
| 338 | + - name: Build in 32-bit container |
| 339 | + run: | |
| 340 | + docker run --rm \ |
| 341 | + -v ${{ github.workspace }}:${{ github.workspace }} \ |
| 342 | + -w ${{ github.workspace }} \ |
| 343 | + i386/ubuntu \ |
| 344 | + /bin/bash -c " \ |
| 345 | + apt-get update -q && \ |
| 346 | + apt-get install -y -q git cmake gcc libcmocka-dev libxxhash-dev libpcre2-dev && \ |
| 347 | + mkdir build && cd build && \ |
| 348 | + cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=ON .. && \ |
| 349 | + cmake --build . && \ |
| 350 | + ctest --output-on-failure \ |
| 351 | + " |
| 352 | +
|
| 353 | + build-big-endian: |
| 354 | + name: Release, Big-endian, s390x |
| 355 | + runs-on: ubuntu-latest |
| 356 | + steps: |
| 357 | + - uses: actions/checkout@main |
| 358 | + |
| 359 | + - name: Build and test |
| 360 | + # use QEMU user-static emulation to run non-x86 Linux |
| 361 | + uses: uraimo/run-on-arch-action@master |
| 362 | + with: |
| 363 | + arch: s390x |
| 364 | + distro: ubuntu22.04 |
| 365 | + |
| 366 | + # speeds up build by caching Docker images in GitHub Packages |
| 367 | + githubToken: ${{ github.token }} |
| 368 | + |
| 369 | + # map the build directory to the container |
| 370 | + dockerRunArgs: | |
| 371 | + --volume "${PWD}:/workspace" |
| 372 | +
|
| 373 | + # install dependencies inside the emulated container |
| 374 | + install: | |
| 375 | + apt-get update -q -y |
| 376 | + apt-get install -q -y git cmake gcc libcmocka-dev libxxhash-dev libpcre2-dev |
| 377 | +
|
| 378 | + # run the build |
| 379 | + run: | |
| 380 | + mkdir build |
| 381 | + cd build |
| 382 | + cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=ON .. |
| 383 | + cmake --build . |
| 384 | + ctest --output-on-failure |
0 commit comments