Skip to content

Commit ecfddb8

Browse files
committed
ci UPDATE add solaris,freebsd,32bit & BE workflows
1 parent 820d68b commit ecfddb8

1 file changed

Lines changed: 136 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 136 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
options: "-DENABLE_TESTS=ON",
2626
packager: "sudo apt-get",
2727
# no expect because stdout seems to be redirected
28-
packages: "libcmocka-dev libxxhash-dev shunit2",
28+
packages: "libcmocka-dev libxxhash-dev",
2929
snaps: "",
3030
build-cmd: "make"
3131
}
@@ -36,7 +36,7 @@ jobs:
3636
cc: "clang",
3737
options: "-DENABLE_TESTS=ON",
3838
packager: "sudo apt-get",
39-
packages: "libcmocka-dev libxxhash-dev shunit2",
39+
packages: "libcmocka-dev libxxhash-dev",
4040
snaps: "",
4141
build-cmd: "make"
4242
}
@@ -47,7 +47,7 @@ jobs:
4747
cc: "gcc",
4848
options: "",
4949
packager: "sudo apt-get",
50-
packages: "libcmocka-dev libxxhash-dev valgrind shunit2",
50+
packages: "libcmocka-dev libxxhash-dev valgrind",
5151
snaps: "",
5252
build-cmd: "make"
5353
}
@@ -59,7 +59,7 @@ jobs:
5959
options: "",
6060
packager: "sudo apt-get",
6161
# 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",
6363
snaps: "",
6464
build-cmd: "make"
6565
}
@@ -70,7 +70,7 @@ jobs:
7070
cc: "clang",
7171
options: "-DENABLE_TESTS=ON -DPATH_EXPECT=",
7272
packager: "brew",
73-
packages: "cmocka xxhash shunit2 tcl-tk",
73+
packages: "cmocka xxhash tcl-tk",
7474
snaps: "",
7575
build-cmd: "make"
7676
}
@@ -241,3 +241,134 @@ jobs:
241241
- name: Install
242242
working-directory: '${{ github.workspace }}/../build'
243243
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 -e
259+
260+
echo "--- SETUP ENVIRONMENT ---"
261+
# Add OpenCSW binary path (where pkgutil installs git/cmake)
262+
export PATH=/opt/csw/bin:$PATH
263+
264+
# Update package catalog and install dependencies
265+
echo "Installing dependencies..."
266+
sudo pkgutil -U
267+
sudo pkgutil -y -i git cmake
268+
269+
echo "--- BUILD CMOCKA ---"
270+
# Only clone if it doesn't exist (prevents failure if rsync synced a cmocka dir)
271+
if [ ! -d "cmocka" ]; then
272+
git clone --depth 1 https://github.com/clibs/cmocka.git
273+
fi
274+
275+
cd cmocka
276+
# clean build dir if it exists from a previous cached run
277+
rm -rf build-cmocka && mkdir build-cmocka
278+
cd build-cmocka
279+
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+
# Point to the local cmocka install
290+
cmake -DCMAKE_BUILD_TYPE=Release \
291+
-DENABLE_TESTS=ON \
292+
-DCMAKE_PREFIX_PATH=$HOME/local \
293+
..
294+
295+
cmake --build .
296+
ctest --output-on-failure
297+
298+
build-freebsd:
299+
name: Release, FreeBSD, clang
300+
runs-on: ubuntu-latest
301+
steps:
302+
- uses: actions/checkout@v4
303+
304+
- name: Build and test
305+
uses: vmactions/freebsd-vm@main
306+
with:
307+
# use the latest stable FreeBSD release
308+
usesh: true
309+
310+
# need to install bash, because check_includes.sh uses it
311+
prepare: |
312+
pkg update -f
313+
pkg install -y cmake cmocka xxhash bash git-lite || pkg install -y git
314+
315+
run: |
316+
mkdir build
317+
cd build
318+
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=ON ..
319+
cmake --build .
320+
ctest --output-on-failure
321+
322+
build-linux-32bit:
323+
name: Release, Linux 32-bit, gcc
324+
runs-on: ubuntu-latest
325+
steps:
326+
- uses: actions/checkout@v4
327+
328+
- name: Build in 32-bit container
329+
run: |
330+
docker run --rm \
331+
-v ${{ github.workspace }}:${{ github.workspace }} \
332+
-w ${{ github.workspace }} \
333+
i386/ubuntu:22.04 \
334+
/bin/bash -c " \
335+
apt-get update -q && \
336+
apt-get install -y -q git cmake gcc libcmocka-dev libxxhash-dev && \
337+
mkdir build && cd build && \
338+
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=ON .. && \
339+
cmake --build . && \
340+
ctest --output-on-failure \
341+
"
342+
343+
build-big-endian:
344+
name: Release, Big-endian, s390x
345+
runs-on: ubuntu-latest
346+
steps:
347+
- uses: actions/checkout@main
348+
349+
- name: Build and test
350+
# use QEMU user-static emulation to run non-x86 Linux
351+
uses: uraimo/run-on-arch-action@master
352+
with:
353+
arch: s390x
354+
distro: ubuntu22.04
355+
356+
# speeds up build by caching Docker images in GitHub Packages
357+
githubToken: ${{ github.token }}
358+
359+
# map the build directory to the container
360+
dockerRunArgs: |
361+
--volume "${PWD}:/workspace"
362+
363+
# install dependencies inside the emulated container
364+
install: |
365+
apt-get update -q -y
366+
apt-get install -q -y git cmake gcc libcmocka-dev libxxhash-dev libpcre2-dev
367+
368+
# run the build
369+
run: |
370+
mkdir build
371+
cd build
372+
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=ON ..
373+
cmake --build .
374+
ctest --output-on-failure

0 commit comments

Comments
 (0)