From 18e7f4796466a1d16695f8cb48d27074337d9234 Mon Sep 17 00:00:00 2001 From: msclock Date: Wed, 6 Mar 2024 12:27:27 +0800 Subject: [PATCH] ci: setup cpp Signed-off-by: msclock --- .github/workflows/pre-commit-autoupdate.yml | 31 ------------ .github/workflows/preview.yml | 56 +++++++++++++++++++++ CMakeLists.txt | 1 - cmake/ConfigureCoverage.cmake | 2 + 4 files changed, 58 insertions(+), 32 deletions(-) delete mode 100644 .github/workflows/pre-commit-autoupdate.yml create mode 100644 .github/workflows/preview.yml diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml deleted file mode 100644 index 6dd1c413..00000000 --- a/.github/workflows/pre-commit-autoupdate.yml +++ /dev/null @@ -1,31 +0,0 @@ -# Auto-update pre-commit -name: pre-commit update -on: - # every midnight on the first day of every month - schedule: - - cron: 0 0 1 * * - # on demand - workflow_dispatch: - -jobs: - auto-update: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v3 - - - name: Update pre-commit hooks - uses: browniebroke/pre-commit-autoupdate-action@main - - - name: Create pull request on pre-commit updates - uses: peter-evans/create-pull-request@v3 - if: ${{ always() }} - with: - branch: update/pre-commit-hooks - title: Update pre-commit hooks - commit-message: 'ci: update pre-commit hooks' - body: Update available versions of pre-commit hooks to latest version. - delete-branch: true diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 00000000..d9e35bb5 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,56 @@ +name: Deploy PR previews + +on: + pull_request: + types: + - opened + - reopened + - synchronize + - closed + +concurrency: + group: preview-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + pages-preview: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + contents: write + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Cpp + uses: aminya/setup-cpp@v1 + with: + compiler: gcc + cmake: true + ninja: true + vcpkg: true + ccache: true + doxygen: true + graphviz: true + gcovr: true + python: true + + - name: Install docs dependencies + run: | + pip install -r docs/requirements.txt + + - name: Configure + env: + VCPKG_ROOT: /home/runner/vcpkg + run: cmake -S . --preset=x64-Debug-GNUC -DBUILD_TESTING=OFF -DCODE_COVERAGE=OFF + + - name: Build Docs + run: cmake --build out/build/x64-Debug-GNUC --target ss-cpp-docs + + - name: Deploy preview + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./docs/_build/html diff --git a/CMakeLists.txt b/CMakeLists.txt index 4db46d63..b0a0aba3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,6 @@ include(cmake-modules/build/Ccache) include(cmake-modules/build/LinkOptimization) include(cmake-modules/test/Default) include(cmake-modules/test/GoogleTest) -include(cmake-modules/test/Coverage) include(cmake-modules/test/Sanitizer) include(cmake-modules/test/Valgrind) include(cmake-modules/install/Common) diff --git a/cmake/ConfigureCoverage.cmake b/cmake/ConfigureCoverage.cmake index 13990b9a..61dda33c 100644 --- a/cmake/ConfigureCoverage.cmake +++ b/cmake/ConfigureCoverage.cmake @@ -1,5 +1,7 @@ include_guard(GLOBAL) +include(cmake-modules/test/Coverage) + # cmake-format: off add_code_coverage_all_targets( EXCLUDE