summaryrefslogtreecommitdiff
path: root/.github/workflows/c-cpp.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/c-cpp.yml')
-rw-r--r--.github/workflows/c-cpp.yml70
1 files changed, 70 insertions, 0 deletions
diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml
new file mode 100644
index 0000000..738e5db
--- /dev/null
+++ b/.github/workflows/c-cpp.yml
@@ -0,0 +1,70 @@
+name: C/C++ CI
+
+on:
+ push:
+ branches: [ "master", "test" ]
+ pull_request:
+ branches: [ "master" ]
+
+jobs:
+ build:
+ strategy:
+ matrix:
+ config:
+ - {
+ os: ubuntu-24.04,
+ cc: "gcc-13",
+ cxx: "g++-13",
+ deps: "gcc-13 g++-13"
+ }
+ - {
+ os: ubuntu-24.04,
+ cc: "clang-16",
+ cxx: "clang++-16",
+ deps: "clang-16"
+ }
+ - {
+ os: ubuntu-24.04,
+ cc: "clang-17",
+ cxx: "clang++-17",
+ deps: "clang-17"
+ }
+ - {
+ os: ubuntu-24.04,
+ cc: "clang-18",
+ cxx: "clang++-18",
+ deps: "clang-18"
+ }
+ runs-on: ${{ matrix.config.os }}
+
+ steps:
+ - uses: actions/checkout@v6
+
+ - name: update apt
+ run: sudo apt update -y
+
+ - name: install compiler
+ run: sudo apt install -y ${{ matrix.config.deps }}
+
+ - name: install tools
+ run: sudo apt install -y meson ninja-build cppcheck clang-tools
+
+ - name: install deps
+ run: |
+ sudo apt install -y libdrm-dev libegl1-mesa-dev libgles2-mesa-dev libwayland-dev \
+ libx11-xcb-dev libx11-dev libgbm-dev libevdev-dev
+
+ - name: configure
+ env:
+ CC: ${{ matrix.config.cc }}
+ CXX: ${{ matrix.config.cxx }}
+ run: SCANBUILD="/usr/bin/scan-build --status-bugs" meson setup -Dkmscube=true -Dpykms=enabled -Dwerror=true -Db_lto=true build
+
+ - name: build
+ run: ninja -v -C build
+
+ - name: Clang static analysis
+ run: SCANBUILD="/usr/bin/scan-build --status-bugs" ninja -C build scan-build
+
+ - name: cppcheck
+ run: cppcheck --quiet --error-exitcode=1 --suppress=*:/usr/include/* --suppress='*:ext/*' --project=build/compile_commands.json