]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
CI: build and run unit tests
authorIker Pedrosa <ipedrosa@redhat.com>
Thu, 14 Sep 2023 12:41:23 +0000 (14:41 +0200)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Fri, 29 Sep 2023 07:24:01 +0000 (09:24 +0200)
Run `make check` after the project is built in every runner.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
.github/workflows/runner.yml
share/containers/alpine.dockerfile
share/containers/debian.dockerfile
share/containers/fedora.dockerfile

index dabe7cdf2a9656b80ef982ced0ccf4b5050abb68..2f0f99633bc5363b74604c3e3519d5504b32f8b4 100644 (file)
@@ -35,7 +35,7 @@ jobs:
         sudo apt-mark hold grub-efi-amd64-bin grub-efi-amd64-signed
         sudo apt-get update
         sudo apt-get -y dist-upgrade
-        sudo apt-get -y install ubuntu-dev-tools automake autopoint xsltproc gettext expect byacc libtool libbsd-dev pkgconf
+        sudo apt-get -y install ubuntu-dev-tools automake autopoint xsltproc gettext expect byacc libtool libbsd-dev pkgconf libcmocka-dev
         sudo apt-get -y build-dep shadow
     - name: configure
       run: |
@@ -83,6 +83,7 @@ jobs:
         cd $d
         ./configure
         make -j5
+        make check
 
   container-build:
     runs-on: ubuntu-latest
index f09ee19ecf6cfcf6ff27ec7153777d50fcd42c18..07d496c3fe7f684d7e8bb06974c40c6e53a85fe1 100644 (file)
@@ -2,8 +2,8 @@ ARG OS_IMAGE="alpine:latest"
 
 FROM "${OS_IMAGE}" AS build
 
-RUN apk add autoconf automake build-base byacc expect gettext-dev git \
-        libbsd-dev libeconf-dev libtool libxslt pkgconf
+RUN apk add autoconf automake build-base byacc cmocka-dev expect gettext-dev \
+        git libbsd-dev libeconf-dev libtool libxslt pkgconf
 
 COPY ./ /usr/local/src/shadow/
 WORKDIR /usr/local/src/shadow/
@@ -11,6 +11,7 @@ WORKDIR /usr/local/src/shadow/
 RUN ./autogen.sh --without-selinux --disable-man --disable-nls --with-yescrypt
 RUN make -kj4 || true
 RUN make
+RUN make check
 RUN make install
 
 FROM scratch AS export
index a9d5ba4bbb7bdfb688ce643b8487834c25ddeb59..5934f287aa3ab0b9f0a0a609f0aa4f20e0bcae60 100644 (file)
@@ -9,7 +9,7 @@ RUN export DEBIAN_PRIORITY=critical \
 RUN apt-get update -y \
     && apt-get dist-upgrade -y
 RUN apt-get build-dep shadow -y
-RUN apt-get install libbsd-dev pkgconf -y
+RUN apt-get install libbsd-dev libcmocka-dev pkgconf -y
 
 COPY ./ /usr/local/src/shadow/
 WORKDIR /usr/local/src/shadow/
@@ -17,6 +17,7 @@ WORKDIR /usr/local/src/shadow/
 RUN ./autogen.sh --without-selinux --enable-man --with-yescrypt
 RUN make -kj4 || true
 RUN make
+RUN make check
 RUN make install
 
 FROM scratch AS export
index b426da2709fc0ebb4c344d33216f61b5211048a5..097a2fbc5aac9b28e1f8fd8719d8be0a0cdf356d 100644 (file)
@@ -2,7 +2,7 @@ ARG OS_IMAGE="fedora:latest"
 
 FROM "${OS_IMAGE}" AS build
 
-RUN dnf install -y dnf-plugins-core
+RUN dnf install -y dnf-plugins-core libcmocka-devel systemd-devel
 RUN dnf builddep -y shadow-utils
 
 COPY ./ /usr/local/src/shadow/
@@ -14,6 +14,7 @@ RUN ./autogen.sh --enable-shadowgrp --enable-man --with-audit \
         --with-group-name-max-length=32 --enable-lastlog --enable-logind=no
 RUN make -kj4 || true
 RUN make
+RUN make check
 RUN make install
 
 FROM scratch AS export