fast inv_sqrt in c #69
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: C++ Memory Checker | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- '**/*.cpp' | |
- '**/*.c' | |
pull_request: | |
branches: [ main ] | |
paths: | |
- '**/*.cpp' | |
- '**/*.c' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install build essentials and valgrind | |
run: | | |
sudo apt update | |
sudo apt install -y build-essential valgrind | |
- name: Valgrind version | |
run: valgrind --version | |
- name: Compile C/C++ Codes | |
run: | | |
for file in $(find . -name "*.c" -o -name "*.cpp"); do | |
echo "Compiling $file" | |
g++ -Wall -Wextra -Wpedantic -Werror -o ${file%.*}.out $file | |
done | |
- name: Run memory check | |
run: | | |
global_exitcode=0 | |
for file in $(find . -name "*.out"); do | |
echo "Checking $file" | |
exitcode=0 | |
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --error-exitcode=1 --tool=memcheck --vgdb=yes --track-origins=yes -s $file > /dev/null 2>&1 || exitcode=$? | |
if [ $exitcode -ne 0 ]; then | |
echo "Memory check failed for $file" | |
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --error-exitcode=1 --tool=memcheck --vgdb=yes --track-origins=yes -s $file | |
if [ $global_exitcode -eq 0 ]; then | |
global_exitcode=$exitcode | |
fi | |
fi | |
done | |
exit $global_exitcode |