From b78a3f49cae81274873760ca97d841e63a99ad03 Mon Sep 17 00:00:00 2001 From: msclock Date: Fri, 3 Nov 2023 18:40:29 +0800 Subject: [PATCH] ci: preview docs Signed-off-by: msclock --- .github/workflows/documentation-links.yml | 24 +++++++++++ .readthedocs.yml | 51 +++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 .github/workflows/documentation-links.yml create mode 100644 .readthedocs.yml diff --git a/.github/workflows/documentation-links.yml b/.github/workflows/documentation-links.yml new file mode 100644 index 00000000..981c3720 --- /dev/null +++ b/.github/workflows/documentation-links.yml @@ -0,0 +1,24 @@ +# https://github.com/readthedocs/actions/tree/main/preview + +name: readthedocs/actions + +on: + pull_request_target: + types: + - opened + +permissions: + pull-requests: write + +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} + +jobs: + + preview-rtd: + runs-on: ubuntu-latest + steps: + - uses: readthedocs/actions/preview@v1 + with: + project-slug: ${{ github.repository }} diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 00000000..20406f6d --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,51 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + apt_packages: + - doxygen + - gcc + - g++ + - git + - bash + - lcov + - openjdk-19-jre + os: ubuntu-22.04 + tools: + python: '3.11' + jobs: + post_create_environment: + - >- + git clone + -c core.eol=lf + -c core.autocrlf=false + -c safe.directory="/tmp/vcpkg" + -c fsck.zeroPaddedFilemode=ignore + -c fetch.fsck.zeroPaddedFilemode=ignore + -c receive.fsck.zeroPaddedFilemode=ignore https://github.com/microsoft/vcpkg /tmp/vcpkg + - /tmp/vcpkg/bootstrap-vcpkg.sh + - /tmp/vcpkg/vcpkg --version + - pip install cmake ninja + pre_build: + - VCPKG_ROOT=/tmp/vcpkg cmake -S . --preset=x64-Debug-GNUC + - cmake --build out/build/x64-Debug-GNUC --parallel 8 --target ccov-all + post_build: + - cp out/build/x64-Debug-GNUC/cpp-scaffold_docs $READTHEDOCS_OUTPUT/html/ -r + + +# Build documentation in the docs/ directory with Sphinx +sphinx: + # Fail on all warnings to avoid broken references + fail_on_warning: true + +# Optional but recommended, declare the Python requirements required +# to build your documentation +# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - requirements: docs/requirements.txt