ci: enable valgrind for build #4666
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |