summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIker Pedrosa <ipedrosa@redhat.com>2023-09-14 14:41:23 +0200
committerIker Pedrosa <ikerpedrosam@gmail.com>2023-09-29 09:24:01 +0200
commit0fc697a4b1bee92e568f0c0ac7e612db88736fcd (patch)
tree747fea57f981d2eb9756640c775daec556dbd6e5
parent015448b049a748126589463b4366a1fbda909c15 (diff)
CI: build and run unit tests
Run `make check` after the project is built in every runner. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
-rw-r--r--.github/workflows/runner.yml3
-rw-r--r--share/containers/alpine.dockerfile5
-rw-r--r--share/containers/debian.dockerfile3
-rw-r--r--share/containers/fedora.dockerfile3
4 files changed, 9 insertions, 5 deletions
diff --git a/.github/workflows/runner.yml b/.github/workflows/runner.yml
index dabe7cdf..2f0f9963 100644
--- a/.github/workflows/runner.yml
+++ b/.github/workflows/runner.yml
@@ -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
diff --git a/share/containers/alpine.dockerfile b/share/containers/alpine.dockerfile
index f09ee19e..07d496c3 100644
--- a/share/containers/alpine.dockerfile
+++ b/share/containers/alpine.dockerfile
@@ -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
diff --git a/share/containers/debian.dockerfile b/share/containers/debian.dockerfile
index a9d5ba4b..5934f287 100644
--- a/share/containers/debian.dockerfile
+++ b/share/containers/debian.dockerfile
@@ -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
diff --git a/share/containers/fedora.dockerfile b/share/containers/fedora.dockerfile
index b426da27..097a2fbc 100644
--- a/share/containers/fedora.dockerfile
+++ b/share/containers/fedora.dockerfile
@@ -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