Skip to content

CI: cleanup and fix linux valgrind tests #350

CI: cleanup and fix linux valgrind tests

CI: cleanup and fix linux valgrind tests #350

Workflow file for this run

name: CI
on:
push:
paths:
- .github/workflows/CI.yml
- CMakeLists.txt
- include/*
- tests/*
- src/*
pull_request:
paths:
- .github/workflows/CI.yml
- CMakeLists.txt
- include/*
- tests/*
- src/*
defaults:
run:
shell: bash
jobs:
windows_msvc:
strategy:
fail-fast: false
matrix:
cxx-std: [11, 14, 17, 20]
name: windows / C++${{ matrix.cxx-std }} / MSVC
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Generate project files
run: cmake . -B build -DCMAKE_CXX_STANDARD=${{ matrix.cxx-std }} -DDYLIB_BUILD_TESTS=ON -DDYLIB_WARNING_AS_ERRORS=ON
- name: Build dynamic library and unit tests
run: cmake --build build
- name: Run unit tests
working-directory: build
run: ctest --verbose
windows_msys2:
defaults:
run:
shell: msys2 {0}
strategy:
fail-fast: false
matrix:
sys: [mingw32, mingw64, ucrt64, clang64]
cxx-std: [11, 14, 17, 20]
name: windows / C++${{ matrix.cxx-std }} / ${{matrix.sys}})
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
install: make
pacboy: toolchain:p cmake:p
- name: Generate project files
run: cmake . -B build -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=${{ matrix.cxx-std }} -DDYLIB_BUILD_TESTS=ON -DDYLIB_WARNING_AS_ERRORS=ON
- name: Build dynamic library and unit tests
run: cmake --build build
- name: Run unit tests
working-directory: build
run: ctest --verbose
linux:
strategy:
fail-fast: false
matrix:
cxx-std: [11, 14, 17, 20]
arch: [64bit, 32bit]
action: [tests, valgrind]
include:
- arch: 64bit
docker_arch: amd64
- arch: 32bit
docker_arch: i386
name: linux ${{ matrix.arch }} ${{ matrix.action }} / C++${{ matrix.cxx-std }} / gcc)
runs-on: ubuntu-latest
container:
# replace with debian 13 (or latest) when available
image: ${{ matrix.docker_arch }}/debian:testing
options: --user root
volumes:
- ${{ github.workspace }}:/workspace
steps:
# https://github.com/actions/upload-artifact/issues/616
- uses: actions/checkout@v1
- name: Update packages
run: apt update
- name: Install build tools
run: apt install -y build-essential cmake valgrind
- name: Generate project files
run: cmake . -B build -DCMAKE_CXX_STANDARD=${{ matrix.cxx-std }} -DDYLIB_BUILD_TESTS=ON -DDYLIB_WARNING_AS_ERRORS=ON
- name: Build dynamic library and unit tests
run: cmake --build build
- name: Run unit tests
if: ${{ matrix.action == 'tests'}}
working-directory: build
run: ctest --verbose
- name: Run unit tests with valgrind
if: ${{ matrix.action == 'valgrind'}}
working-directory: build
run: valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1 ./unit_tests
macos:
strategy:
fail-fast: false
matrix:
cxx-std: [11, 14, 17, 20]
arch: [intel, silicon, universal]
action: [tests, leaks]
include:
- arch: intel
osx_arch: x86_64
- arch: silicon
osx_arch: arm64
- arch: universal
osx_arch: arm64;x86_64
name: macos ${{ matrix.arch }} ${{ matrix.action }} / C++${{ matrix.cxx-std }} / clang
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Generate project files
run: cmake . -B build "-DCMAKE_OSX_ARCHITECTURES=${{ matrix.osx_arch }}" -DCMAKE_CXX_STANDARD=${{ matrix.cxx-std }} -DDYLIB_BUILD_TESTS=ON -DDYLIB_WARNING_AS_ERRORS=ON
- name: Build dynamic library and unit tests
run: cmake --build build
- name: Run unit tests
if: ${{ matrix.action == 'tests'}}
working-directory: build
run: ctest --verbose
- name: Run unit tests with leaks
if: ${{ matrix.action == 'leaks'}}
working-directory: build
run: leaks -atExit -- ./unit_tests