summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/c-cpp.yml70
-rw-r--r--.github/workflows/ci.yml86
2 files changed, 70 insertions, 86 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
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
deleted file mode 100644
index 3eb168a..0000000
--- a/.github/workflows/ci.yml
+++ /dev/null
@@ -1,86 +0,0 @@
-name: CI
-
-on:
- pull_request:
- branches: [master]
- push:
- branches: [master, test]
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
-
-jobs:
- lint:
- name: lint (uncrustify + ruff)
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v6
-
- - uses: actions/setup-python@v6
- with:
- python-version: '3.x'
-
- - name: Install uncrustify
- run: |
- sudo apt-get update
- sudo apt-get install -y uncrustify
-
- - name: Install ruff
- run: pip install ruff
-
- - name: uncrustify --check
- run: |
- files=$(git ls-files '*.cpp' '*.h')
- uncrustify -c uncrustify.cfg -l CPP --check $files
-
- - name: ruff check
- run: ruff check .
-
- - name: ruff format --check
- run: ruff format --check .
-
- build:
- name: build (${{ matrix.compiler }})
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- compiler: [gcc, clang]
- steps:
- - uses: actions/checkout@v6
-
- - uses: actions/setup-python@v6
- with:
- python-version: '3.x'
-
- - name: Install build dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y meson ninja-build
- if [ "${{ matrix.compiler }}" = "clang" ]; then
- sudo apt-get install -y clang
- fi
-
- - name: Configure meson
- run: |
- if [ "${{ matrix.compiler }}" = "clang" ]; then
- export CC=clang CXX=clang++
- else
- export CC=gcc CXX=g++
- fi
- meson setup build
-
- - name: Compile
- run: meson compile -C build
-
- - name: Run native tests
- run: meson test -C build --print-errorlogs
-
- - name: Install pixpat wheel
- run: pip install .
-
- - name: Run pytest
- run: |
- pip install pytest
- pytest pixpat-python/tests