labwc/.github/workflows/build.yml
2024-04-10 08:14:59 +02:00

212 lines
6.6 KiB
YAML

# Void-musl images:
# https://github.com/void-linux/void-containers/pkgs/container/void-musl
#
# Void dependencies based on:
# https://github.com/void-linux/void-packages/blob/master/srcpkgs/labwc/template
#
# Recommended GH CI Void mirror based on
# https://docs.voidlinux.org/xbps/repositories/mirrors/changing.html
name: CI
on: [pull_request]
jobs:
codestyle:
name: CodeStyleCheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Code Style
run: |
./scripts/check
make -C scripts/helper
./scripts/find-banned.sh
build:
name: Build
needs: codestyle
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
name: [
Arch,
Debian,
FreeBSD,
Void-musl
]
include:
- name: Arch
os: ubuntu-latest
container: archlinux:base-devel
env:
TARGET: 'sh -xe'
- name: Debian
os: ubuntu-latest
container: debian:testing
env:
TARGET: 'sh -xe'
- name: FreeBSD
os: ubuntu-latest
env:
TARGET: 'ssh freebsd /bin/sh -xe'
- name: Void-musl
os: ubuntu-latest
container: ghcr.io/void-linux/void-musl:latest
env:
TARGET: 'sh -xe'
env: ${{ matrix.env }}
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v1
- name: Install Arch Linux dependencies
if: matrix.name == 'Arch'
run: |
pacman-key --init
pacman -Syu --noconfirm
pacman -S --noconfirm git meson clang wlroots libdrm libinput \
wayland-protocols cairo pango libxml2 xorg-xwayland librsvg \
libdisplay-info
- name: Install Debian Testing dependencies
if: matrix.name == 'Debian'
run: |
sed -i '/^Types/ s/deb/& deb-src/' /etc/apt/sources.list.d/debian.sources
apt-get update
apt-get upgrade -y
apt-get install -y git gcc clang gdb xwayland
apt-get build-dep -y labwc
- name: Install FreeBSD dependencies
if: matrix.name == 'FreeBSD'
uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: |
sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
pkg set -yn pkg:mesa-dri # hack to skip llvm dependency
pkg install -y git meson gcc pkgconf cairo pango evdev-proto \
hwdata wayland-protocols wlroots libdisplay-info
run: echo "setup done"
- name: Install Void Linux dependencies
if: matrix.name == 'Void-musl'
run: |
mkdir -p /etc/xbps.d
cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
sed -i "s:repo-default\.voidlinux\.org:repo-ci.voidlinux.org:g" \
/etc/xbps.d/*-repository-*.conf
xbps-install -Syu || xbps-install -yu xbps
xbps-install -Syu
xbps-install -y git meson gcc clang pkg-config scdoc \
cairo-devel glib-devel libpng-devel librsvg-devel libxml2-devel \
pango-devel wlroots0.17-devel gdb bash xorg-server-xwayland \
dejavu-fonts-ttf
# These build are executed on all runners
- name: Build with gcc
run: |
echo '
cd "$GITHUB_WORKSPACE"
export CC=gcc
meson setup build-gcc -Dxwayland=enabled --werror
meson compile -C build-gcc
' | $TARGET
- name: Build with clang
run: |
echo '
cd "$GITHUB_WORKSPACE"
export CC=clang
meson setup build-clang -Dxwayland=enabled --werror
meson compile -C build-clang
' | $TARGET
- name: Build with gcc - no-xwayland
run: |
echo '
cd "$GITHUB_WORKSPACE"
export CC=gcc
meson setup build-gcc-no-xwayland -Dxwayland=disabled --werror
meson compile -C build-gcc-no-xwayland
' | $TARGET
- name: Build with clang - no-xwayland
run: |
echo '
cd "$GITHUB_WORKSPACE"
export CC=clang
meson setup build-clang-no-xwayland -Dxwayland=disabled --werror
meson compile -C build-clang-no-xwayland
' | $TARGET
- name: Build with gcc - release
run: |
echo '
cd "$GITHUB_WORKSPACE"
export CC=gcc
meson setup build-gcc-release -Dxwayland=enabled \
-Dbuildtype=release -Db_ndebug=true --werror
meson compile -C build-gcc-release
' | $TARGET
- name: Build with gcc - static analyzer
run: |
echo '
cd "$GITHUB_WORKSPACE"
export CC=gcc
meson setup build-gcc-static_analyzer -Dxwayland=enabled \
-Dstatic_analyzer=enabled --werror
meson compile -C build-gcc-static_analyzer
' | $TARGET
# Runtime tests, these run on Debian and Void only (the later due to libmusl being used)
- name: Build with clang - release
run: |
echo '
cd "$GITHUB_WORKSPACE"
export CC=clang
meson setup build-clang-release -Dxwayland=enabled \
-Dbuildtype=release -Db_ndebug=true --werror
meson compile -C build-clang-release
' | $TARGET
- name: Build with gcc - runtime test
if: matrix.name == 'Debian'
run: |
echo '
cd "$GITHUB_WORKSPACE"
export CC=gcc
meson setup build-gcc-ci -Dxwayland=enabled -Db_sanitize=undefined --werror
meson compile -C build-gcc-ci
scripts/ci/smoke-test.sh build-gcc-ci
' | $TARGET
- name: Build with clang - runtime test
if: matrix.name == 'Debian'
run: |
echo '
cd "$GITHUB_WORKSPACE"
export CC=clang
meson setup build-clang-ci -Dxwayland=enabled -Db_sanitize=undefined --werror
meson compile -C build-clang-ci
scripts/ci/smoke-test.sh build-clang-ci
' | $TARGET
# Void-musl doesn't support sanitizer
- name: Build with gcc - runtime test w/o sanitizer
if: matrix.name == 'Void-musl'
run: |
echo '
cd "$GITHUB_WORKSPACE"
export CC=gcc
meson setup build-gcc-ci -Dxwayland=enabled --werror
meson compile -C build-gcc-ci
LABWC_RUNS=20 scripts/ci/smoke-test.sh build-gcc-ci
' | $TARGET