feat(workflow): add CI

This commit is contained in:
Lysec
2026-04-20 12:29:09 +02:00
parent 082813b965
commit e8f5937343
+62
View File
@@ -0,0 +1,62 @@
name: CI
on:
push:
branches: [main, master]
pull_request:
# Cancel in-progress runs for the same branch/PR when new commits land.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
format:
name: clang-format
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends clang-format
- name: Check formatting
run: |
mapfile -d '' files < <(find src \( -name '*.cpp' -o -name '*.h' \) -print0)
clang-format --dry-run -Werror "${files[@]}"
build:
name: Build (${{ matrix.buildtype }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
buildtype: [debug, release]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
meson ninja-build g++ pkg-config \
libwayland-dev wayland-protocols \
libegl-dev libgles-dev \
libfreetype-dev libharfbuzz-dev libfontconfig-dev \
libcairo2-dev libpango1.0-dev \
libxkbcommon-dev \
libsdbus-c++-dev libpipewire-0.3-dev \
libpam0g-dev libcurl4-openssl-dev libwebp-dev
- name: Configure
run: |
args=(--buildtype=${{ matrix.buildtype }})
if [ "${{ matrix.buildtype }}" = "release" ]; then
args+=(-Db_lto=true)
fi
meson setup build-${{ matrix.buildtype }} "${args[@]}"
- name: Build
run: meson compile -C build-${{ matrix.buildtype }}