Skip to content

Commit 536f380

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

File tree

1 file changed

+137
-5
lines changed

1 file changed

+137
-5
lines changed

.github/workflows/ci.yml

Lines changed: 137 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,135 @@ 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
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 \
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: Build and test
304+
uses: vmactions/freebsd-vm@main
305+
with:
306+
# use the latest stable FreeBSD release
307+
usesh: true
308+
309+
# need to install bash, because check_includes.sh uses it
310+
prepare: |
311+
pkg update -f
312+
pkg install -y cmake cmocka xxhash bash git-lite || pkg install -y git
313+
314+
run: |
315+
set -x
316+
set -e
317+
mkdir build
318+
cd build
319+
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=ON ..
320+
cmake --build .
321+
ctest --output-on-failure
322+
323+
build-linux-32bit:
324+
name: Release, Linux 32-bit, gcc
325+
runs-on: ubuntu-latest
326+
steps:
327+
- uses: actions/checkout@v4
328+
329+
- name: Build in 32-bit container
330+
run: |
331+
docker run --rm \
332+
-v ${{ github.workspace }}:${{ github.workspace }} \
333+
-w ${{ github.workspace }} \
334+
i386/ubuntu \
335+
/bin/bash -c " \
336+
apt-get update -q && \
337+
apt-get install -y -q git cmake gcc libcmocka-dev libxxhash-dev libpcre2-dev && \
338+
mkdir build && cd build && \
339+
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=ON .. && \
340+
cmake --build . && \
341+
ctest --output-on-failure \
342+
"
343+
344+
build-big-endian:
345+
name: Release, Big-endian, s390x
346+
runs-on: ubuntu-latest
347+
steps:
348+
- uses: actions/checkout@main
349+
350+
- name: Build and test
351+
# use QEMU user-static emulation to run non-x86 Linux
352+
uses: uraimo/run-on-arch-action@master
353+
with:
354+
arch: s390x
355+
distro: ubuntu22.04
356+
357+
# speeds up build by caching Docker images in GitHub Packages
358+
githubToken: ${{ github.token }}
359+
360+
# map the build directory to the container
361+
dockerRunArgs: |
362+
--volume "${PWD}:/workspace"
363+
364+
# install dependencies inside the emulated container
365+
install: |
366+
apt-get update -q -y
367+
apt-get install -q -y git cmake gcc libcmocka-dev libxxhash-dev libpcre2-dev
368+
369+
# run the build
370+
run: |
371+
mkdir build
372+
cd build
373+
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=ON ..
374+
cmake --build .
375+
ctest --output-on-failure

0 commit comments

Comments
 (0)