Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ jobs:
- name: Checkout this repository
uses: actions/checkout@v4.1.6

- name: Configure and check formatting
- name: Configure Project
uses: threeal/cmake-action@v1.3.0
with:
run-build: true
build-args: --target format --target check-format
options: BUILD_TESTING=ON

- name: Check Formatting
run: |
cmake --build build --target format-all
git diff --exit-code HEAD
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ target_include_directories(result INTERFACE include)
target_link_libraries(result INTERFACE error)

if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
cpmaddpackage(
GITHUB_REPOSITORY TheLartians/Format.cmake
VERSION 1.8.0
OPTIONS "FORMAT_SKIP_CMAKE ON"
)

if(BUILD_TESTING)
enable_testing()

Expand All @@ -44,4 +38,8 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
target_link_libraries(result_test PRIVATE result Catch2::Catch2WithMain)
catch_discover_tests(result_test)
endif()

cpmaddpackage(gh:threeal/FixFormat.cmake@1.1.1)
include(${FixFormat_SOURCE_DIR}/cmake/FixFormat.cmake)
add_fix_format()
endif()