Skip to content

ci: enable valgrind for build #4666

ci: enable valgrind for build

ci: enable valgrind for build #4666

Workflow file for this run

name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
build_type: [Release, Debug]
compiler: [gcc, clang]
os: [ubuntu-20.04, ubuntu-22.04, macos-latest]
exclude:
- os: macos-latest
compiler: gcc
env:
CC: ${{ matrix.compiler }}
CMAKE_GENERATOR: Ninja
steps:
- uses: actions/checkout@v4
- name: openssl path macos
if: ${{ runner.os == 'macOS' }}
run: |
echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl)" >> $GITHUB_ENV
- name: install packages
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get update && sudo apt-get install -y ninja-build valgrind
- name: install packages
if: ${{ runner.os == 'macOS' }}
run: |
brew install ninja
- name: make info
run: |
echo "OS: ${{ matrix.os }}"
echo "--- ${{ matrix.compiler }} DEBUG VERSION ---"
${{ matrix.compiler }} - --version
- name: cmake
run: |
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_C_FLAGS="-Werror"
cmake --build build -t retest
- name: retest
run: |
./build/test/retest -r -v
- name: retest with valgrind
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: |
valgrind --leak-check=full --show-reachable=yes --error-exitcode=42 ./build/test/retest -r -v