Skip to content

Commit

Permalink
ci: Add memory leak check
Browse files Browse the repository at this point in the history
  • Loading branch information
oboukli committed Sep 1, 2023
1 parent a228693 commit 3f02b8d
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/runtime-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
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

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 7: GitHub-owned GitHubAction not pinned by hash
Click Remediation section below to solve this issue
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: Instrument tromino with Valgrind Memcheck
run: >-
/usr/bin/valgrind
--tool=memcheck
--leak-check=full
--show-leak-kinds=yes
./tromino 8 3 7
working-directory: ${{ env.BUILD_PATH }}/src

- name: Start Xvfb
run: Xvfb :99 -screen 0 1024x768x24 &

- name: Instrument tromino2d with Valgrind Memcheck
env:
DISPLAY: :99
run: >-
/usr/bin/valgrind
--tool=memcheck
--leak-check=full
--show-leak-kinds=yes
./tromino2d 8 3 7
working-directory: ${{ env.BUILD_PATH }}/src

0 comments on commit 3f02b8d

Please sign in to comment.