]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
github: Introduce shared build logic
authorStéphane Graber <stgraber@stgraber.org>
Thu, 19 Dec 2024 03:12:22 +0000 (22:12 -0500)
committerStéphane Graber <stgraber@stgraber.org>
Thu, 19 Dec 2024 03:23:13 +0000 (22:23 -0500)
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
.github/actions/build/action.yml [new file with mode: 0644]

diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml
new file mode 100644 (file)
index 0000000..c77e62d
--- /dev/null
@@ -0,0 +1,67 @@
+name: Build LXC
+description: Install dependencies and build the codebase
+inputs:
+  compiler:
+    required: true
+  os:
+    required: true
+  variant:
+    required: true
+
+runs:
+  using: "composite"
+  steps:
+    - name: Install dependencies
+      shell: bash
+      run: |
+        sudo apt-get update -qq
+        sudo apt-get install -qq \
+            ${{ inputs.compiler }} \
+            meson \
+            pkg-config \
+            uuid-runtime \
+            docbook2x \
+            linux-libc-dev \
+            llvm \
+            libapparmor-dev \
+            libcap-dev \
+            libdbus-1-dev \
+            libpam0g-dev \
+            libseccomp-dev \
+            libselinux1-dev
+
+    - name: Compiler version
+      shell: bash
+      env:
+        CC: ${{ inputs.compiler }}
+      run: |
+        ${CC} --version
+
+    - name: Build
+      shell: bash
+      env:
+        CC: ${{ inputs.compiler }}
+      run: |
+        # Standard build
+        if [ "${{ inputs.variant }}" = "default" ]; then
+            meson setup build \
+                -Dprefix=/usr \
+                -Dtests=true \
+                -Dpam-cgroup=true \
+                -Dtools-multicall=true \
+                -Dwerror=true \
+                -Db_lto_mode=default
+        elif [ "${{ inputs.variant }}" = "sanitizer" ]; then
+            meson setup build \
+                -Dprefix=/usr \
+                -Dtests=true \
+                -Dpam-cgroup=true \
+                -Dtools-multicall=true \
+                -Dwerror=true \
+                -Db_lto_mode=default \
+                -Dio-uring-event-loop=false \
+                -Db_lundef=false \
+                -Db_sanitize=address,undefined
+        fi
+
+        meson compile -C build