CI: Add single-header build

This commit is contained in:
Florian Albrechtskirchinger 2022-06-11 09:28:37 +02:00
parent ee1cef2f2b
commit a8df5da3f8
No known key found for this signature in database
GPG Key ID: 19618CE9B2D4BE6D
2 changed files with 24 additions and 0 deletions

View File

@ -43,6 +43,16 @@ jobs:
- name: build - name: build
run: cmake --build build --target ${{ matrix.target }} run: cmake --build build --target ${{ matrix.target }}
ci_test_single_header:
runs-on: ubuntu-latest
container: ghcr.io/nlohmann/json-ci:v2.4.0
steps:
- uses: actions/checkout@v3
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build --target ci_test_single_header
ci_cmake_options: ci_cmake_options:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: ghcr.io/nlohmann/json-ci:v2.4.0 container: ghcr.io/nlohmann/json-ci:v2.4.0

View File

@ -581,6 +581,20 @@ add_custom_target(ci_test_amalgamation
COMMENT "Check amalgamation and indentation" COMMENT "Check amalgamation and indentation"
) )
###############################################################################
# Build and test using the amalgamated header
###############################################################################
add_custom_target(ci_test_single_header
COMMAND CXX=${GCC_TOOL} CXXFLAGS="${GCC_CXXFLAGS}" ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DJSON_MultipleHeader=OFF -DJSON_FastTests=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_single_header
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_single_header
COMMAND cd ${PROJECT_BINARY_DIR}/build_single_header && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMENT "Compile and test single-header version"
)
############################################################################### ###############################################################################
# Valgrind. # Valgrind.
############################################################################### ###############################################################################