Skip to content

Commit

Permalink
ci: add direct test workflow
Browse files Browse the repository at this point in the history
Add a direct workflow that runs the meson based test suite with our
pre-defined environments.

In recent years, github-actions has acquired all the features we need,
and thus the c-util wrapper has lost significance. Rather than hiding
all the details, create a new alternative CI run that directly encodes
all the tests we require.

Signed-off-by: David Rheinsberg <david@readahead.eu>
  • Loading branch information
dvdhrm committed Jul 5, 2023
1 parent dd2a42a commit 5c02a9e
Show file tree
Hide file tree
Showing 2 changed files with 131 additions and 26 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/ci.yml

This file was deleted.

131 changes: 131 additions & 0 deletions .github/workflows/meson-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: "Meson Test Suite"

on:
pull_request:
push:
branches-ignore: ["pr/**"]
tags: ["**"]
workflow_dispatch:

defaults:
run:
shell: "bash"

jobs:
unittest:
name: "Unittest - ${{ matrix.id }} - ${{ matrix.name }}"

strategy:
fail-fast: false
matrix:
include:
- id: "release"
name: "RELEASE @ CLANG-X86_64 @ +TEST -VALGRIND @ -APPARMOR +AUDIT +DOCS +LAUNCHER -SELINUX"

# Explicitly set all options here to document them.
buildtype: "debugoptimized"
cc: "clang"
cflags: "-Werror"
m32: "no"
setupargs: "-Daudit=true -Ddocs=true -Dlauncher=true"
test: "yes"
valgrind: "no"
warnlevel: "2"

- id: "32bit"
name: "RELEASE @ CLANG-I686 @ +TEST -VALGRIND @ -APPARMOR +AUDIT -DOCS +LAUNCHER -SELINUX"

buildtype: "debugoptimized"
cc: "clang"
cflags: "-m32 -Werror"
m32: "yes"
setupargs: "-Daudit=true -Dlauncher=true"
test: "yes"
warnlevel: "2"

- id: "valgrind"
name: "RELEASE @ CLANG-X86_64 @ +TEST +VALGRIND @ -APPARMOR +AUDIT -DOCS -LAUNCHER -SELINUX"

buildtype: "debugoptimized"
cc: "clang"
cflags: "-Werror"
setupargs: "-Daudit=true -Dlauncher=false"
test: "yes"
valgrind: "yes"
warnlevel: "2"

- id: "O0-PLAIN"
name: "PLAIN @ GCC-X86_64 @ +TEST -VALGRIND @ -APPARMOR +AUDIT -DOCS +LAUNCHER -SELINUX"

buildtype: "plain"
cc: "gcc"
cflags: "-O0 -Werror"
setupargs: "-Daudit=true -Dlauncher=true"
test: "yes"
warnlevel: "2"

- id: "O3-NDEBUG"
name: "OPTIMIZED @ GCC-X86_64 @ +TEST -VALGRIND @ -APPARMOR +AUDIT -DOCS +LAUNCHER -SELINUX"

buildtype: "release"
cc: "gcc"
cflags: "-O3 -Werror -DNDEBUG"
setupargs: "-Daudit=true -Dlauncher=true"
test: "yes"
warnlevel: "2"

container:
image: "ghcr.io/bus1/ci-c-util:latest"

env:
CC: ${{ matrix.cc }}
CFLAGS: ${{ matrix.cflags }}

runs-on: "ubuntu-latest"

steps:
- name: "Fetch Sources"
uses: actions/checkout@v3

- name: "Setup 32-bit Environment"
if: matrix.m32 == 'yes'
run: |
echo \
"PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/share/pkgconfig" \
>> $GITHUB_ENV
- name: "Setup Meson"
run: |
meson setup \
--buildtype "${{ matrix.buildtype }}" \
--warnlevel "${{ matrix.warnlevel }}" \
${{ matrix.setupargs }} \
"./build" \
"."
- name: "Compile Project"
run: |
meson compile \
-C "./build"
- name: "Run Tests"
if: matrix.test == 'yes'
run: |
meson test \
-C "./build" \
--print-errorlogs
- name: "Run Valgrind"
if: matrix.valgrind == 'yes'
run: |
args=(
"--gen-suppressions=all"
"--trace-children=yes"
"--leak-check=full"
"--error-exitcode=1"
)
meson test \
-C "./build" \
--print-errorlogs \
--timeout-multiplier=16 \
--wrapper="valgrind ${args[*]}"

0 comments on commit 5c02a9e

Please sign in to comment.