From 8bfbf8ecf19ba307bbda12ecc6c23012ff2292d1 Mon Sep 17 00:00:00 2001 From: Almamu Date: Sat, 17 May 2025 05:20:04 +0200 Subject: [PATCH] chore: only compile Catch2 if a testing build is requested and run cmake on any branch after tests --- .github/workflows/cmake.yml | 6 +++--- .github/workflows/tests.yml | 5 +++-- CMakeLists.txt | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index eb9555f..8236370 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -3,16 +3,16 @@ name: CMake on: workflow_run: workflows: [tests] - branches: [main] types: [completed] + workflow_dispatch: push: paths: - 'protocols/**' - branches: [ "main" ] + branches: [main] pull_request: paths: - 'protocols/**' - branches: [ "main" ] + branches: [main] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8d7dda0..81f166d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,13 +6,14 @@ on: - 'src/**' - 'CMakeModules/**' - CMakeLists.txt - branches: [ "main" ] + branches: [main] + workflow_dispatch: pull_request: paths: - 'src/**' - 'CMakeModules/**' - CMakeLists.txt - branches: [ "main" ] + branches: [main] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) diff --git a/CMakeLists.txt b/CMakeLists.txt index b4f8cc0..ded0f29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,8 +116,9 @@ add_subdirectory(src/External/glslang-WallpaperEngine glslang) add_subdirectory(src/External/SPIRV-Cross-WallpaperEngine spirv-cross) add_subdirectory(src/External/kissfft kissfft) add_subdirectory(src/External/argparse argparse) -add_subdirectory(src/External/Catch2) - +if(BUILD_TESTING) + add_subdirectory(src/External/Catch2) +endif() # try to enable wayland builds when possible pkg_check_modules(WAYLAND_SUPPORT wayland-cursor wayland-protocols egl wayland-egl)