Skip to content

Commit 68e66b8

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

File tree

1 file changed

+146
-5
lines changed

1 file changed

+146
-5
lines changed

.github/workflows/ci.yml

Lines changed: 146 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,144 @@ 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 -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

Comments
 (0)