]> git.mdlowis.com Git - proto/labwc.git/commitdiff
CI: add unit tests
authortokyo4j <hrak1529@gmail.com>
Mon, 29 Sep 2025 07:13:37 +0000 (16:13 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Mon, 29 Sep 2025 18:41:32 +0000 (19:41 +0100)
.github/workflows/build.yml

index 2b76b4d2f09e23a0d51943e6d38237d0b2563e89..0cf69f85047bd1c73f4ee0c2847fcf657c5eafa5 100644 (file)
@@ -82,7 +82,7 @@ jobs:
           pacman -Syu --noconfirm
           pacman -S --noconfirm git meson clang wlroots0.19 libdrm libinput \
             wayland-protocols cairo pango libxml2 xorg-xwayland librsvg \
-            libdisplay-info gdb ttf-dejavu foot libsfdo
+            libdisplay-info gdb ttf-dejavu foot libsfdo cmocka
 
       - name: Install Debian Testing dependencies
         if: matrix.name == 'Debian'
@@ -207,6 +207,18 @@ jobs:
             meson compile -C build-gcc-no-feature
           ' | $TARGET
 
+      # Unit tests, run on Arch only
+      - name: Build with gcc - unit test
+        if: matrix.name == 'Arch'
+        run: |
+          echo '
+            cd "$GITHUB_WORKSPACE"
+            export CC=gcc
+            meson setup build-gcc-unit-test -Dtest=enabled --werror
+            meson compile -C build-gcc-unit-test
+            meson test -C build-gcc-unit-test --print-errorlogs
+          ' | $TARGET
+
       # Runtime tests, these run on Arch and Void only (the later due to libmusl being used)
       - name: Build with gcc - runtime test
         if: matrix.name == 'Arch'