ci: Add memory leak check #1
Workflow file for this run
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: Runtime checks on Ubuntu | |
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: Valgrind | |
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 }} |