WIP: setup Cpp workflow #116
@@ -0,0 +1,44 @@
|
||||
name: Build (C++)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build-zshell:
|
||||
runs-on: alpine
|
||||
container: archlinux:latest
|
||||
|
||||
steps:
|
||||
- name: Install all packages
|
||||
run: |
|
||||
pacman-key --init
|
||||
pacman-key --populate archlinux
|
||||
pacman -Syu --noconfirm \
|
||||
base-devel \
|
||||
cmake \
|
||||
ninja \
|
||||
pkgconf \
|
||||
sudo \
|
||||
git \
|
||||
qt6-base \
|
||||
qt6-declarative \
|
||||
qt6-shadertools \
|
||||
pipewire \
|
||||
libqalculate \
|
||||
glib2 \
|
||||
aubio \
|
||||
cava
|
||||
|
||||
- name: Install libcava (AUR)
|
||||
run: |
|
||||
useradd -m builduser
|
||||
passwd -d builduser
|
||||
echo 'builduser ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||
sudo -u builduser git clone https://aur.archlinux.org/libcava.git /tmp/libcava
|
||||
sudo -u builduser makepkg -si --noconfirm -p /tmp/libcava/PKGBUILD
|
||||
|
||||
- name: Configure
|
||||
run: cmake -S . -B build -G Ninja
|
||||
|
||||
- name: Build ZShell
|
||||
run: cmake --build build --target ZShell
|
||||
@@ -0,0 +1,27 @@
|
||||
name: Lint & Format (C++)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint-format:
|
||||
runs-on: alpine
|
||||
container: node:26-alpine
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install tools
|
||||
run: |
|
||||
apk add --no-cache \
|
||||
clang-extra-tools \
|
||||
git
|
||||
|
||||
- name: Clang Format
|
||||
run: |
|
||||
if find . -type f \( -name "*.cpp" -o -name "*.hpp" -o -name "*.h" \) -print -quit | grep -q .; then
|
||||
find . -type f \( -name "*.cpp" -o -name "*.hpp" -o -name "*.h" \) -print0 | xargs -0 clang-format --dry-run --Werror
|
||||
else
|
||||
echo "No C++ files found"
|
||||
fi
|
||||
Reference in New Issue
Block a user