diff --git a/.github/workflows/asciidoctor-ghpages.yml b/.github/workflows/asciidoctor-ghpages.yml index bd4b2e6..6d920eb 100644 --- a/.github/workflows/asciidoctor-ghpages.yml +++ b/.github/workflows/asciidoctor-ghpages.yml @@ -40,7 +40,7 @@ jobs: node-version: 20 - name: Install Mermaid run: | - sudo npm install -g @mermaid-js/mermaid-cli@11.2.0 + sudo npm install -g @mermaid-js/mermaid-cli@11.2.1 - name: Install asciidoctor run: | sudo apt update diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 715fcbc..bf3c095 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,7 @@ jobs: - name: Install Mermaid run: | - sudo npm install -g @mermaid-js/mermaid-cli@11.2.0 + sudo npm install -g @mermaid-js/mermaid-cli@11.2.1 - name: Install asciidoctor run: | @@ -75,24 +75,13 @@ jobs: run: | pip install mypy black - - name: Restore CPM cache - env: - cache-name: cpm-cache-0 - id: cpm-cache-restore - uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 - with: - path: ~/cpm-cache - key: ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }} - restore-keys: | - ${{runner.os}}-${{env.cache-name}}- - - name: Configure cmake for lib env: CC: "/usr/lib/llvm-${{env.TARGET_LLVM_VERSION}}/bin/clang" CXX: "/usr/lib/llvm-${{env.TARGET_LLVM_VERSION}}/bin/clang++" PR_TARGET_BRANCH: ${{ steps.target_branch.outputs.branch }} working-directory: ${{github.workspace}}/test/library - run: cmake -Bbuild -DCPM_SOURCE_CACHE=~/cpm-cache + run: cmake -Bbuild - name: Check lib quality working-directory: ${{github.workspace}}/test/library @@ -100,7 +89,22 @@ jobs: - name: Build lib docs working-directory: ${{github.workspace}}/test/library - run: cmake --build build -t docs + run: | + ls -laR + cmake --build build -v -t docs + cmake --build build clean + test $(cmake --build build -v -t docs | grep -c ERROR) == 0 + + - name: Restore CPM cache + env: + cache-name: cpm-cache-0 + id: cpm-cache-restore + uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 + with: + path: ~/cpm-cache + key: ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }} + restore-keys: | + ${{runner.os}}-${{env.cache-name}}- - name: Configure cmake for app env: diff --git a/ci/.github/workflows/asciidoctor-ghpages.yml b/ci/.github/workflows/asciidoctor-ghpages.yml index 1182a6c..62ef6fd 100644 --- a/ci/.github/workflows/asciidoctor-ghpages.yml +++ b/ci/.github/workflows/asciidoctor-ghpages.yml @@ -40,7 +40,7 @@ jobs: node-version: 20 - name: Install Mermaid run: | - sudo npm install -g @mermaid-js/mermaid-cli@11.2.0 + sudo npm install -g @mermaid-js/mermaid-cli@11.2.1 - name: Install asciidoctor run: | sudo apt update diff --git a/cmake/main.cmake b/cmake/main.cmake index 3ef3f82..5b4a738 100644 --- a/cmake/main.cmake +++ b/cmake/main.cmake @@ -28,6 +28,10 @@ option(INFRA_PROVIDE_PRESETS "Provide cmake presets and toolchains" ON) option(INFRA_PROVIDE_MULL "Provide mull.yml file" ON) option(INFRA_PROVIDE_PYTEST_REQS "Provide pip requirements.txt for python tests" ON) +option( + INFRA_PROVIDE_PUPPETEER_CONFIG + "Provide puppeteer_config.json for generating mermaid diagrams in documentation" + ON) option(INFRA_PROVIDE_GITIGNORE "Add provided things to .gitignore" ON) option(INFRA_USE_SYMLINKS "Use symlinks to provide common files" ON) @@ -38,6 +42,8 @@ if(${PROJECT_SOURCE_DIR}/cmake STREQUAL CMAKE_CURRENT_LIST_DIR) set(INFRA_PROVIDE_CMAKE_FORMAT OFF) set(INFRA_PROVIDE_PRESETS OFF) set(INFRA_PROVIDE_MULL OFF) + set(INFRA_PROVIDE_PYTEST_REQS OFF) + set(INFRA_PROVIDE_PUPPETEER_CONFIG OFF) set(INFRA_PROVIDE_GITIGNORE OFF) endif() diff --git a/cmake/setup.cmake b/cmake/setup.cmake index df72fec..a8b8134 100644 --- a/cmake/setup.cmake +++ b/cmake/setup.cmake @@ -46,6 +46,11 @@ function(make_gitignore) list(APPEND GITIGNORE_CONTENTS "requirements.txt") endif() endif() + if(INFRA_PROVIDE_PUPPETEER_CONFIG) + if(NOT EXISTS "${CMAKE_SOURCE_DIR}/docs/puppeteer_config.json") + list(APPEND GITIGNORE_CONTENTS "docs/puppeteer_config.json") + endif() + endif() endif() string(REPLACE ";" "\n" GITIGNORE_CONTENTS "${GITIGNORE_CONTENTS}") @@ -61,6 +66,10 @@ function(make_gitignore) endfunction() function(put_in_project_dir FILENAME) + get_filename_component(DIRNAME ${FILENAME} DIRECTORY) + execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory + "${CMAKE_SOURCE_DIR}/${DIRNAME}") + if(INFRA_USE_SYMLINKS) set(put_command "create_symlink") else() @@ -120,6 +129,9 @@ if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) if(INFRA_PROVIDE_PYTEST_REQS) put_in_project_dir("requirements.txt") endif() + if(INFRA_PROVIDE_PUPPETEER_CONFIG) + put_in_project_dir("docs/puppeteer_config.json") + endif() if(INFRA_PROVIDE_GITHUB_WORKFLOWS) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory diff --git a/docs/index.adoc b/docs/index.adoc index bf3c6a9..7b77645 100644 --- a/docs/index.adoc +++ b/docs/index.adoc @@ -5,6 +5,7 @@ :rouge-style: base16.solarized :source-language: c++ :toc: left +:mermaid-puppeteer-config: puppeteer_config.json include::intro.adoc[] include::options.adoc[] diff --git a/docs/puppeteer_config.json b/docs/puppeteer_config.json new file mode 100644 index 0000000..3201af7 --- /dev/null +++ b/docs/puppeteer_config.json @@ -0,0 +1,3 @@ +{ + "args": ["--no-sandbox"] +} diff --git a/test/application/clean.sh b/test/application/clean.sh index de82536..9c583d7 100755 --- a/test/application/clean.sh +++ b/test/application/clean.sh @@ -9,6 +9,8 @@ rm -f mull.yml rm -f .gitignore rm -f CMakePresets.json rm -f toolchains +rm -f requirements.txt +rm -rf docs rm -rf build rm -rf .github diff --git a/test/library/clean.sh b/test/library/clean.sh index de82536..da8b214 100755 --- a/test/library/clean.sh +++ b/test/library/clean.sh @@ -9,6 +9,8 @@ rm -f mull.yml rm -f .gitignore rm -f CMakePresets.json rm -f toolchains +rm -f requirements.txt +rm -f docs/puppeteer_config.json rm -rf build rm -rf .github diff --git a/test/library/docs/index.adoc b/test/library/docs/index.adoc index bfd434d..56c9039 100644 --- a/test/library/docs/index.adoc +++ b/test/library/docs/index.adoc @@ -6,6 +6,7 @@ Ben Deane :rouge-style: base16.solarized :source-language: c++ :toc: left +:mermaid-puppeteer-config: puppeteer_config.json == Introduction diff --git a/test/verify_links.sh b/test/verify_links.sh index 51d1347..50d12b1 100755 --- a/test/verify_links.sh +++ b/test/verify_links.sh @@ -4,7 +4,7 @@ set -euo pipefail echo "Verifying links in "`pwd` -links=( .clang-format .clang-tidy .cmake-format.yaml CMakePresets.json toolchains ) +links=( .clang-format .clang-tidy .cmake-format.yaml CMakePresets.json docs/puppeteer_config.json mull.yml requirements.txt toolchains ) for l in "${links[@]}" do if ! [[ -L "application/${l}" ]]; then