]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
github: Add clang workflow main
authorTom Hromatka <tom.hromatka@oracle.com>
Tue, 29 Jul 2025 15:39:08 +0000 (09:39 -0600)
committerKamalesh Babulal <kamalesh.babulal@oracle.com>
Fri, 1 Aug 2025 09:02:21 +0000 (14:32 +0530)
Add a workflow that will build libcgroup using clang.  Do not use the
setup-libcgroup action as it assumes GCC configurations.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
.github/workflows/continuous-integration.yml

index 42c8eab5c83a46ad573021f242f47a85525f6e4d..184991f48af0515eca8486c12d80033b40e1f9ca 100644 (file)
@@ -94,6 +94,35 @@ jobs:
         publish_dir: ./doc/html
         publish_branch: doxygen/${{ github.ref_name }}
 
+  build-with-clang:
+    name: Build with Clang
+    runs-on: ubuntu-latest
+    env:
+      CC: clang
+      CXX: clang++
+    steps:
+    - uses: actions/checkout@v4
+      with:
+        submodules: false
+    - name: Install dependencies
+      run: |
+        while sudo fuser /var/{lib/{dpkg,apt/lists},cache/apt/archives}/lock >/dev/null 2>&1; do sleep 3; done
+        sudo apt-get update
+        sudo apt-get install libpam-dev python3-pip python3-dev cmake bison flex byacc g++ autoconf automake libtool libsystemd-dev clang -y
+    - name: Install cython
+      run: sudo pip install cython
+    - name: Bootstrap
+      run: ./bootstrap.sh
+    - name: Reconfigure libcgroup with unit tests enabled
+      run: CFLAGS="$CFLAGS -Werror" ./configure --sysconfdir=/etc --localstatedir=/var --enable-opaque-hierarchy="name=systemd" --enable-python --enable-unittests
+    - name: Build libcgroup
+      run: make
+    - name: Run unit tests
+      run: |
+        pushd tests/gunit
+        make check
+        popd
+
   unit-tests:
     name: Unit Tests
     runs-on: ubuntu-latest