Skip to content

ci: Add memory leak check #3

ci: Add memory leak check

ci: Add memory leak check #3

Workflow file for this run

name: Instrumentation
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
BUILD_PATH: ${{ github.workspace }}/build
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Update dependency list
run: sudo apt-get update
- name: Install dependencies
run: >-
sudo apt-get install
--assume-yes
--quiet
autoconf-archive
libboost-test-dev
libsdl2-dev
valgrind
- name: Run autogen.sh
run: ./autogen.sh
- name: Configure build
run: |-
mkdir '${{ env.BUILD_PATH }}'
cd '${{ env.BUILD_PATH }}'
../configure \
CPPFLAGS='-DTROMINO_2D_HEADLESS -DDEBUG' \
CFLAGS='-g -O0' \
CXXFLAGS='-g -O0' \
--prefix='/dbg'
- name: Make
run: make --jobs=$((($(nproc) * 15) / 10))
working-directory: ${{ env.BUILD_PATH }}
- name: Start Xvfb
run: Xvfb :99 -screen 0 1024x768x24 &
- name: Instrumentation with Valgrind Memcheck
env:
DISPLAY: :99
run: >-
/usr/bin/valgrind
--tool=memcheck
--leak-check=full
--show-leak-kinds=all
./tromino2d 8 3 7
working-directory: ${{ env.BUILD_PATH }}