Skip to content

Add static analysis workflow #655

Add static analysis workflow

Add static analysis workflow #655

Workflow file for this run

name: CMake
on:
push:
branches: [ master, feature/gh-actions, feature/compositor-ng ]
pull_request:
branches: [ master, feature/gh-actions, feature/compositor-ng ]
workflow_dispatch:
jobs:
pi4:
name: Build and Test on Raspberry Pi 4
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
# - ARM
- ARM64
graphics-backends:
- vulkan-only
- opengl-only
- vulkan-and-opengl
compiler:
- gcc
- clang
build-type:
- Debug
- Release
include:
- graphics-backends: 'vulkan-only'
enable-vulkan: 'on'
enable-opengl: 'off'
- graphics-backends: 'opengl-only'
enable-vulkan: 'off'
enable-opengl: 'on'
- graphics-backends: 'vulkan-and-opengl'
enable-vulkan: 'on'
enable-opengl: 'on'
- enable-opengl: 'on'
opengl-deps: 'libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev'
- enable-vulkan: 'on'
vulkan-deps: 'libvulkan-dev'
- compiler: 'clang'
clang-deps: 'clang'
steps:
# On the self-hosted runners, we assume those are already installed.
# - name: Install dependencies
# run: |
# id
# sudo apt-get install -y \
# git cmake libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev \
# ttf-mscorefonts-installer fontconfig libsystemd-dev libinput-dev libudev-dev \
# libxkbcommon-dev ninja-build libgstreamer-plugins-base1.0-dev \
# ${{ matrix.vulkan-deps }} \
# ${{ matrix.clang-deps }}
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Configure CMake
run: |
cmake \
-B ./build \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DCMAKE_C_COMPILER=${{ matrix.compiler }} \
-DBUILD_GSTREAMER_AUDIO_PLAYER_PLUGIN=On \
-DBUILD_GSTREAMER_VIDEO_PLAYER_PLUGIN=On \
-DENABLE_VULKAN=${{ matrix.enable-vulkan }} \
-DENABLE_OPENGL=${{ matrix.enable-opengl }} \
-DENABLE_TESTS=On \
-GNinja
echo test
- name: Build
run: cmake --build ./build --config ${{ matrix.build-type }}
- name: Test
working-directory: build
run: ctest -C ${{ matrix.build-type }} --output-on-failure
container:
name: Build & Test in Container
runs-on: ubuntu-latest
container:
image: ${{ matrix.container }}
env:
DEBIAN_FRONTEND: noninteractive
strategy:
matrix:
container:
- 'debian:bullseye'
- 'debian:buster'
graphics-backends:
- vulkan-only
- opengl-only
- vulkan-and-opengl
compiler:
- gcc
- clang
build-type:
- Debug
- Release
sentry-plugin:
- 'off'
- 'on-inproc'
- 'on-crashpad-bundled'
- 'on-crashped-unbundled'
include:
- graphics-backends: 'vulkan-only'
enable-vulkan: 'on'
enable-opengl: 'off'
- graphics-backends: 'opengl-only'
enable-vulkan: 'off'
enable-opengl: 'on'
- graphics-backends: 'vulkan-and-opengl'
enable-vulkan: 'on'
enable-opengl: 'on'
- enable-opengl: 'on'
opengl-deps: 'libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev'
- enable-vulkan: 'on'
vulkan-deps: 'libvulkan-dev'
- compiler: 'gcc'
cxx-compiler: 'g++'
gcc-deps: 'gcc g++'
- compiler: 'clang'
cxx-compiler: 'clang++'
clang-deps: 'clang'
- sentry-plugin: 'off'
sentry-plugin-enable: 'off'
sentry-deps: ''
- sentry-plugin: 'on-inproc'
sentry-plugin-enable: 'on'
sentry-backend: 'inproc'
sentry-deps: 'libcurl4-openssl-dev'
- sentry-plugin: 'on-crashpad-bundled'
sentry-plugin-enable: 'on'
sentry-backend: 'crashpad'
sentry-bundled-crashpad-handler: 'on'
sentry-deps: 'libcurl4-openssl-dev'
- senty-plugin: 'on-crashped-unbundled'
sentry-plugin-enable: 'on'
sentry-backend: 'crashpad'
sentry-bundled-crashpad-handler: 'off'
sentry-deps: 'libcurl4-openssl-dev'
steps:
# git needs to be installed before checking out, otherwise the checkout will fallback to the REST API,
# and the submodule download won't work.
- name: Install dependencies
run: |
apt-get update && apt-get install -y \
git cmake libdrm-dev libgbm-dev \
fonts-liberation fontconfig libsystemd-dev libinput-dev libudev-dev \
libxkbcommon-dev ninja-build libgstreamer-plugins-base1.0-dev \
${{ matrix.vulkan-deps }} \
${{ matrix.opengl-deps }} \
${{ matrix.gcc-deps }} \
${{ matrix.clang-deps }} \
${{ matrix.sentry-deps }}
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Configure CMake
run: |
cmake \
-B ./build \
-S . \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DCMAKE_C_COMPILER=${{ matrix.compiler }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx-compiler }} \
-DBUILD_GSTREAMER_AUDIO_PLAYER_PLUGIN=On \
-DBUILD_GSTREAMER_VIDEO_PLAYER_PLUGIN=On \
-DENABLE_VULKAN=${{ matrix.enable-vulkan }} \
-DENABLE_OPENGL=${{ matrix.enable-opengl }} \
-DENABLE_TESTS=On \
-DBUILD_SENTRY_PLUGIN=${{ matrix.sentry-plugin-enable }} \
-DSENTRY_BACKEND=${{ matrix.sentry-backend }} \
-DSENTRY_PLUGIN_BUNDLE_CRASHPAD_HANDLER=${{ matrix.sentry-bundled-crashpad-handler }} \
-GNinja
- name: Build
run: cmake --build ./build --config ${{ matrix.build-type }}
- name: Test
working-directory: build
run: ctest -C ${{ matrix.build-type }} --output-on-failure
required:
name: required checks
needs: [pi4, container]
runs-on: ubuntu-latest
steps:
- run: |
echo 'all required checks passed.'