Skip to content

Valgrind

Valgrind #138

name: Valgrind
on:
workflow_dispatch:
release:
types:
- published
schedule:
- cron: "0 0 * * 1" # Runs every Monday at midnight UTC
env:
BUILD_TYPE: Debug
jobs:
valgrind:
permissions:
actions: read
contents: read
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu GCC
os: ubuntu-24.04
compiler: gcc-13
compilercxx: g++-13
- name: Ubuntu Clang
os: ubuntu-24.04
compiler: clang
compilercxx: clang++
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: Restore vcpkg cache
id: vcpkg-cache
uses: TAServers/vcpkg-cache@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
prefix: vcpkg-valgrind/
- name: Configure CMake ${{ matrix.os }}-${{ matrix.compilercxx }}
env:
VCPKG_FEATURE_FLAGS: "binarycaching" # Possibly redundant, but explicitly sets the binary caching feature flag
VCPKG_BINARY_SOURCES: "clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite"
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.compilercxx }}
CFLAGS: ${{ matrix.cflags }}
CXXFLAGS: ${{ matrix.cxxflags }}
run: |
cmake -B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DPSAPI_BUILD_DOCS=OFF \
-DPSAPI_BUILD_BENCHMARKS=OFF \
-DPSAPI_BUILD_EXAMPLES=ON \
-DPSAPI_BUILD_PYTHON=OFF
- name: Build ${{ matrix.os }}-${{ matrix.compilercxx }}
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.compilercxx }}
CFLAGS: ${{ matrix.cflags }}
CXXFLAGS: ${{ matrix.cxxflags }}
run: |
cmake --build ${{github.workspace}}/build \
--config ${{env.BUILD_TYPE}} \
--parallel $(getconf _NPROCESSORS_ONLN || sysctl -n hw.ncpu || echo %NUMBER_OF_PROCESSORS%)
- name: Run Valgrind
if: matrix.os == 'ubuntu-24.04'
working-directory: ${{github.workspace}}/build/PhotoshopTest
run: |
sudo apt-get update
sudo apt-get install -y valgrind
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./PhotoshopTest
continue-on-error: false