GitHub/Actions: Add an action building the project with GCC-13/Ubuntu
authorWook Song <wook16.song@samsung.com>
Fri, 2 Feb 2024 06:37:42 +0000 (15:37 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Tue, 6 Feb 2024 04:47:41 +0000 (13:47 +0900)
This patch adds an action that checks the PR by building the project
using GCC-13 on Ubuntu 20.04 and 22.04.

Signed-off-by: Wook Song <wook16.song@samsung.com>
.github/workflows/ubuntu_gcc_native.yml [new file with mode: 0644]

diff --git a/.github/workflows/ubuntu_gcc_native.yml b/.github/workflows/ubuntu_gcc_native.yml
new file mode 100644 (file)
index 0000000..31b0b8b
--- /dev/null
@@ -0,0 +1,33 @@
+name: Native build in Ubuntu 20.04/22.04 with GCC-13
+
+on:
+  pull_request:
+    branches: [ main ]
+
+jobs:
+  build:
+    runs-on: ${{ matrix.os }}
+    env:
+      BUILD_DIR: build
+    strategy:
+      matrix:
+        os: [ ubuntu-20.04, ubuntu-22.04 ]
+
+    steps:
+    - uses: actions/checkout@v4
+    - name: add a PPA for gcc-13
+      run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test
+    - name: install gcc-13
+      run: sudo apt-get update && sudo apt-get install -y gcc-13 g++-13
+    - name: install the meson and ninja build systems
+      run: python3 -m pip install meson ninja
+    - name: install build requirements
+      run: |
+        sudo apt-get install -y libunwind-dev libgstreamer1.0-dev libsystemd-dev \
+          libjson-glib-dev
+    - run: meson setup $BUILD_DIR
+      env:
+        CC: gcc-13
+        CXX: g++-13
+    - run: meson compile -C $BUILD_DIR
+    # TODO: Add compile time unit testing