diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 8f70f9586..1b477c9e5 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -147,3 +147,12 @@ jobs: run: python -m pip install reuse - name: REUSE lint run: reuse lint + + ci_test_documentation: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: cmake + run: cmake -S . -B build -DJSON_CI=On + - name: build + run: cmake --build build --target ci_test_documentation diff --git a/cmake/ci.cmake b/cmake/ci.cmake index e959edb56..0f74c3ea0 100644 --- a/cmake/ci.cmake +++ b/cmake/ci.cmake @@ -934,6 +934,16 @@ add_custom_target(ci_icpc COMMENT "Compile and test with ICPC" ) +############################################################################### +# test documentation +############################################################################### + +add_custom_target(ci_test_documentation + COMMAND make check_output_portable -j8 + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/docs + COMMENT "Check that all examples compile and create the desired output" +) + ############################################################################### # Clean up all generated files. ############################################################################### diff --git a/docs/Makefile b/docs/Makefile index 0de57e00f..78cbc1127 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -28,6 +28,9 @@ create_output: $(EXAMPLES:.cpp=.output) # check output of all stand-alone example files check_output: $(EXAMPLES:.cpp=.test) +# check output of all stand-alone example files (exclude meta which is dependent on the current compiler) +check_output_portable: $(filter-out meta.test,$(EXAMPLES:.cpp=.test)) + clean: rm -fr $(EXAMPLES:.cpp=) $(MAKE) clean -C docset