Add container build for umockdev

This commit is contained in:
Benjamin Berg
2022-02-18 17:00:45 +01:00
committed by Tormod Volden
parent 50b5838183
commit 0666aff354
3 changed files with 74 additions and 1 deletions

View File

@@ -34,3 +34,6 @@ jobs:
- name: udev
shell: bash
run: .private/ci-build.sh --build-dir build-udev -- --enable-udev
- name: umockdev test
run: .private/ci-container-build.sh docker.io/amd64/ubuntu:rolling

70
.private/ci-container-build.sh Executable file
View File

@@ -0,0 +1,70 @@
#!/bin/bash
set -eu
# keep container around if $DEBUG is set
[ -n "${DEBUG:-}" ] || OPTS="--rm"
if type podman >/dev/null 2>&1; then
RUNC=podman
else
RUNC="sudo docker"
fi
MOUNT_MODE=":ro"
$RUNC run --interactive ${RUNC_OPTIONS:-} ${OPTS:-} --volume `pwd`:/source${MOUNT_MODE:-} ${1:-docker.io/amd64/ubuntu:rolling} /bin/bash << EOF
set -ex
# avoid meson exit code 125; https://github.com/containers/podman/issues/11540
trap '[ \$? -eq 0 ] || exit 1' EXIT
# go-faster apt
echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/90nolanguages
# upgrade
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y eatmydata
eatmydata apt-get -y --purge dist-upgrade
# install build and test dependencies
eatmydata apt-get install -y make libtool libudev-dev pkg-config umockdev libumockdev-dev
# run build as user
useradd build
su -s /bin/bash - build << EOG
set -ex
mkdir "/tmp/builddir"
cd "/tmp/builddir"
CFLAGS="-O2"
# enable extra warnings
CFLAGS+=" -Winline"
CFLAGS+=" -Wmissing-include-dirs"
CFLAGS+=" -Wnested-externs"
CFLAGS+=" -Wpointer-arith"
CFLAGS+=" -Wredundant-decls"
CFLAGS+=" -Wswitch-enum"
export CFLAGS
echo ""
echo "Configuring ..."
/source/configure --enable-examples-build --enable-tests-build
echo ""
echo "Building ..."
make -j4 -k
echo ""
echo "Running umockdev tests ..."
tests/umockdev
echo "Running stress tests ..."
tests/stress
EOG
EOF

View File

@@ -1 +1 @@
#define LIBUSB_NANO 11701
#define LIBUSB_NANO 11702