Skip to content

chore(deps): update dependency https://github.com/serious-scaffold/ss-cpp to v1.7.3 #409

chore(deps): update dependency https://github.com/serious-scaffold/ss-cpp to v1.7.3

chore(deps): update dependency https://github.com/serious-scaffold/ss-cpp to v1.7.3 #409

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches:
- master
- beta
- alpha
- '*.x'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5
with:
python-version: 3.11
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
with:
extra_args: --hook-stage manual --all-files
check-on-linux:
runs-on: ubuntu-24.04
needs: [pre-commit]
strategy:
matrix:
triplet: [x64-linux]
compiler: [gcc-14, llvm-18]
std: [20]
build_type: [Debug, RelWithDebInfo]
name: check • ${{ matrix.triplet }} • ${{ matrix.compiler }} • c++${{ matrix.std }} • ${{ matrix.build_type }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: |
~/vcpkg
~/.cache/vcpkg
key: ${{ matrix.triplet }}-${{ matrix.compiler }}-${{ hashFiles('vcpkg.json') }}
restore-keys: ${{ matrix.triplet }}-${{ matrix.compiler }}-${{ hashFiles('vcpkg.json') }}
- uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
cmake: true
ninja: true
ccache: true
- name: Prepare for lcov
if: contains(matrix.compiler, 'gcc')
run: |
sudo apt-get update; sudo apt-get install lcov -y
gcc_compiler=${{ matrix.compiler }}
gcov_version=${gcc_compiler##*-}
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-$gcov_version 100
- name: Prepare for llvm-cov
if: contains(matrix.compiler, 'llvm')
run: |
llvm_compiler=${{ matrix.compiler }}
llvm_cov_version=${llvm_compiler##*-}
sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-$llvm_cov_version 100
- name: Configure CMake
run: >
cmake -S . --preset=default
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_CXX_STANDARD=${{ matrix.std }}
-DCMAKE_C_COMPILER=${{ contains(matrix.compiler, 'gcc') && 'gcc' || contains(matrix.compiler, 'llvm') && 'clang' }}
-DCMAKE_CXX_COMPILER=${{ contains(matrix.compiler, 'gcc') && 'g++' || contains(matrix.compiler, 'llvm') && 'clang++' }}
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }}
-DCODE_COVERAGE=ON
-DBUILD_TESTING=ON
- name: Build
run: cmake --build --preset=default --target all
- name: Test
run: ctest --preset=default
- name: Install
run: cmake --build --preset=default --target install
- name: Uninstall
run: cmake --build --preset=default --target uninstall
- name: Coverage
run: cmake --build --preset=default --target ccov-all
check-on-macos:
if: false
runs-on: macos-14
needs: [pre-commit]
strategy:
matrix:
triplet: [arm64-osx]
compiler: [gcc@14, llvm@18]
std: [23]
build_type: [Debug, RelWithDebInfo]
name: check • ${{ matrix.triplet }} • ${{ matrix.compiler }} • c++${{ matrix.std }} • ${{ matrix.build_type }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: |
~/vcpkg
~/.cache/vcpkg
key: ${{ matrix.triplet }}-${{ matrix.compiler }}-${{ hashFiles('vcpkg.json') }}
restore-keys: ${{ matrix.triplet }}-${{ matrix.compiler }}-${{ hashFiles('vcpkg.json') }}
- name: Install compilers and tools
run: |
brew install ${{ matrix.compiler }} cmake ninja ccache lcov
- name: Prepare PATH for compilers
run: echo "PATH=/usr/local/opt/${{ matrix.compiler }}/bin:$PATH" >> $GITHUB_ENV
- name: Prepare for llvm
if: contains(matrix.compiler, 'llvm')
run: |
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Prepare for gcc
if: contains(matrix.compiler, 'gcc')
run: |
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
compiler=${{ matrix.compiler }}
gcov_version=${compiler##*@}
echo "GCOV=$(which gcov-$gcov_version)" >> $GITHUB_ENV
- name: Configure CMake
run: >
cmake -S . --preset=default
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_CXX_STANDARD=${{ matrix.std }}
-DCMAKE_C_COMPILER="${CC}"
-DCMAKE_CXX_COMPILER="${CXX}"
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }}
-DCODE_COVERAGE=ON
-DBUILD_TESTING=ON
${{ contains(matrix.compiler, 'gcc') && '-DCODE_COVERAGE_GCOV=${GCOV}' }}
- name: Build
run: cmake --build --preset=default --target all
- name: Test
run: ctest --preset=default
- name: Install
run: cmake --build --preset=default --target install
- name: Uninstall
run: cmake --build --preset=default --target uninstall
- name: Coverage
run: cmake --build --preset=default --target ccov-all
check-on-windows:
runs-on: windows-2022
needs: [pre-commit]
strategy:
matrix:
triplet: [x64-windows]
compiler: [msvc-2022, llvm-18]
std: [20]
build_type: [Debug, RelWithDebInfo]
name: check • ${{ matrix.triplet }} • ${{ matrix.compiler }} • c++${{ matrix.std }} • ${{ matrix.build_type }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: |
~/vcpkg
~/.cache/vcpkg
~/AppData/Local/vcpkg
key: ${{ matrix.triplet }}-${{ matrix.compiler }}-${{ hashFiles('vcpkg.json') }}
restore-keys: ${{ matrix.triplet }}-${{ matrix.compiler }}-${{ hashFiles('vcpkg.json') }}
- uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: true
cmake: true
ninja: true
ccache: true
opencppcoverage: true
- name: Configure CMake
run: >
cmake -S . --preset=default ${{ contains(matrix.compiler, 'llvm') && '-DVCPKG_PLATFORM_TOOLSET=ClangCL' || '' }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_CXX_STANDARD=${{ matrix.std }}
-DCMAKE_C_COMPILER=${{ contains(matrix.compiler, 'msvc') && '"cl"' || contains(matrix.compiler, 'llvm') && '"clang-cl.exe"' }}
-DCMAKE_CXX_COMPILER=${{ contains(matrix.compiler, 'msvc') && '"cl"' || contains(matrix.compiler, 'llvm') && '"clang-cl.exe"' }}
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }}
-DCODE_COVERAGE=ON
-DBUILD_TESTING=ON
- name: Build
run: cmake --build --preset=default --target all
- name: Test
run: ctest --preset=default
- name: Install
run: cmake --build --preset=default --target install
- name: Uninstall
run: cmake --build --preset=default --target uninstall
- name: Coverage
run: cmake --build --preset=default --target ccov-all
check-mingw:
runs-on: windows-2022
needs: [pre-commit]
strategy:
matrix:
triplet: [x64-mingw-dynamic]
compiler: [mingw]
std: [20]
build_type: [Debug, RelWithDebInfo]
name: check • ${{ matrix.triplet }} • ${{ matrix.compiler }} • c++${{ matrix.std }} • ${{ matrix.build_type }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: |
~/vcpkg
~/.cache/pip
~/.cache/vcpkg
~/AppData/Local/vcpkg
key: ${{ matrix.triplet }}-${{ matrix.compiler }}-${{ hashFiles('vcpkg.json') }}
restore-keys: ${{ matrix.triplet }}-${{ matrix.compiler }}-${{ hashFiles('vcpkg.json') }}
- uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
cmake: true
ninja: true
ccache: true
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5
with:
python-version: 3.x
- name: Prepare for gcovr
run: |
pip install gcovr==8.3
- name: Configure CMake
run: >
cmake -S . --preset=default
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_CXX_STANDARD=${{ matrix.std }}
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
-DVCPKG_TARGET_TRIPLET=x64-mingw-dynamic
-DCODE_COVERAGE=ON
-DBUILD_TESTING=ON
- name: Build
run: cmake --build --preset=default --target all
- name: Test
run: ctest --preset=default
- name: Install
run: cmake --build --preset=default --target install
- name: Uninstall
run: cmake --build --preset=default --target uninstall
- name: Coverage
run: cmake --build --preset=default --target ccov-all
check-sanitizers:
runs-on: ubuntu-24.04
needs: [pre-commit]
strategy:
matrix:
sanitizer:
- address,undefined
build_type: [Debug, RelWithDebInfo]
name: check • sanitizers • ${{ matrix.sanitizer }} • ${{ matrix.build_type }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: |
~/vcpkg
~/.cache/vcpkg
key: x64-linux-gcc-14-${{ hashFiles('vcpkg.json') }}
restore-keys: x64-linux-gcc-14-${{ hashFiles('vcpkg.json') }}
- uses: aminya/setup-cpp@v1
with:
compiler: gcc-14
cmake: true
ninja: true
ccache: true
- name: Configure CMake
run: >
cmake -S . --preset=default
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_CXX_STANDARD=20
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
-DVCPKG_TARGET_TRIPLET=x64-linux
-DUSE_SANITIZER=${{ matrix.sanitizer }}
-DBUILD_TESTING=ON
- name: Build
run: cmake --build --preset=default --target all
- name: Test
run: ctest --preset=default
check-valgrind:
runs-on: ubuntu-24.04
needs: [pre-commit]
strategy:
matrix:
build_type: [Debug, RelWithDebInfo]
name: check • valgrind • ${{ matrix.build_type }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: |
~/vcpkg
~/.cache/vcpkg
key: x64-linux-gcc-14-${{ hashFiles('vcpkg.json') }}
restore-keys: x64-linux-gcc-14-${{ hashFiles('vcpkg.json') }}
- uses: aminya/setup-cpp@v1
with:
compiler: gcc-14
cmake: true
ninja: true
ccache: true
- name: Install valgrind
run: sudo apt-get install valgrind
# Use Valgrind must disable sanitizer
- name: Configure CMake
run: >
cmake -S . --preset=default
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_CXX_STANDARD=20
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
-DVCPKG_TARGET_TRIPLET=x64-linux
-DUSE_VALGRIND=ON
-DBUILD_TESTING=ON
- name: Build
run: cmake --build --preset=default --target all
- name: Valgrind
run: cmake --build --preset=default --target ExperimentalMemCheck | tee out/valgrind.log
- name: Check if valgrind found some errors
run: |
if grep -q "Memory Leak" out/valgrind.log; then
echo "# :error: Memory Leak found! Please fix it." >> $GITHUB_STEP_SUMMARY
echo -e "References: \n - <https://valgrind.org/docs/manual/manual.html>\n - <https://stackoverflow.com/a/44989219/23467261>" >> $GITHUB_STEP_SUMMARY
tar -czf out/valgrind-results.tar.gz out/build/default/Testing
exit 1
fi
- name: Upload test results
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: valgrind-results
path: out/valgrind-results.tar.gz
clang-tidy:
runs-on: ubuntu-24.04
needs: [pre-commit]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: |
~/vcpkg
~/.cache/vcpkg
key: x64-linux-gcc-14-${{ hashFiles('vcpkg.json') }}
restore-keys: x64-linux-gcc-14-${{ hashFiles('vcpkg.json') }}
- uses: aminya/setup-cpp@v1
with:
compiler: gcc-14
cmake: true
ninja: true
ccache: true
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5
with:
python-version: 3.x
- name: Install latest clang-tidy
run: |
pip install clang-tidy==19.1.0.1
- name: Configure CMake
run: >
cmake -S . --preset=default
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_CXX_STANDARD=20
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
-DVCPKG_TARGET_TRIPLET=x64-linux
-DUSE_CLANGTIDY=ON
-DUSE_CLANGTIDY_WARNINGS_AS_ERRORS=ON
-DBUILD_TESTING=ON
- name: Build
run: cmake --build --preset=default --target all
cppcheck:
runs-on: ubuntu-24.04
needs: [pre-commit]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: |
~/vcpkg
~/.cache/vcpkg
key: x64-linux-gcc-14-${{ hashFiles('vcpkg.json') }}
restore-keys: x64-linux-gcc-14-${{ hashFiles('vcpkg.json') }}
- uses: aminya/setup-cpp@v1
with:
compiler: gcc-14
cmake: true
ninja: true
ccache: true
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5
with:
python-version: 3.x
- name: Install latest cppcheck
run: |
pip install cppcheck==1.5.0
- name: Configure CMake
run: >
cmake -S . --preset=default
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_CXX_STANDARD=20
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
-DVCPKG_TARGET_TRIPLET=x64-linux
-DUSE_CPPCHECK=ON
-DUSE_CPPCHECK_WARNINGS_AS_ERRORS=ON
-DBUILD_TESTING=ON
- name: Build
run: cmake --build --preset=default --target all
check-docs:
runs-on: ubuntu-24.04
needs: [pre-commit]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: |
~/vcpkg
~/.cache/pip
~/.cache/vcpkg
key: x64-linux-gcc-14-${{ hashFiles('vcpkg.json') }}
restore-keys: x64-linux-gcc-14-${{ hashFiles('vcpkg.json') }}
- uses: aminya/setup-cpp@v1
with:
compiler: gcc-14
cmake: true
ninja: true
ccache: true
doxygen: true
graphviz: true
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5
with:
python-version: 3.x
- name: Configure CMake
run: >
make cmake-configure CONFIGURE="
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_CXX_STANDARD=20
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
-DVCPKG_TARGET_TRIPLET=x64-linux
"
- name: Checks the docs with warnings as errors
run: make docs-check
codecov:
runs-on: ubuntu-24.04
needs: [pre-commit]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: |
~/vcpkg
~/.cache/vcpkg
key: x64-linux-gcc-14-${{ hashFiles('vcpkg.json') }}
restore-keys: x64-linux-gcc-14-${{ hashFiles('vcpkg.json') }}
- uses: aminya/setup-cpp@v1
with:
compiler: gcc-14
cmake: true
ninja: true
ccache: true
- name: Prepare for lcov
run: |
sudo apt-get update; sudo apt-get install lcov -y
gcc_compiler=gcc-14
gcov_version=${gcc_compiler##*-}
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-$gcov_version 100
- name: Configure CMake
run: >
cmake -S . --preset=default
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_CXX_STANDARD=20
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
-DVCPKG_TARGET_TRIPLET=x64-linux
-DCODE_COVERAGE=ON
-DBUILD_TESTING=ON
- name: Build
run: cmake --build --preset=default --target all
- name: Coverage
run: cmake --build --preset=default --target ccov-all
- name: Upload coverage report
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
disable_search: true
files: ./out/build/default/code_coverage/coverage.info
verbose: true
pass:
if: always()
needs:
- check-on-linux
- check-on-windows
- check-mingw
- check-docs
- check-sanitizers
- check-valgrind
- clang-tidy
- cppcheck
- codecov
runs-on: ubuntu-24.04
timeout-minutes: 2
permissions:
pull-requests: write
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
- name: Approve pr if all jobs succeeded
if: contains(github.event.pull_request.labels.*.name, 'auto-approval') && contains(github.actor, '[bot]')
uses: hmarr/auto-approve-action@v4