catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
Add CodeQL, Codecov, Dependabot, Codacy and contribution checks for Catch3
- Commit
f5e8586fc5640d21798ce4ab1229d1b9387665d1- Author
- Leitwolf11 ·
- Parents
6e8e2fd83c5c
Changes
.codacy.yml | 10 +++++++++ .github/codeql/codeql-config.yml | 9 ++++++++ .github/dependabot.yml | 14 ++++++++++++ .github/pull_request_template.md | 42 +++++++++++++++++------------------ .github/workflows/codeql.yml | 33 +++++++++++++++++++++++++++ .github/workflows/coverage.yml | 48 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 134 insertions(+), 22 deletions(-) diff --git a/.codacy.yml b/.codacy.yml new file mode 100644 index 00000000..f6c92774 --- /dev/null +++ b/.codacy.yml @@ -0,0 +1,10 @@ +--- +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1 + +exclude_paths: + - 'build/**' + - 'bazel-*/**' + - 'docs/doxygen/**' + - 'projects/Generated/**' + diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 00000000..7277cf89 --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1 + +name: Catch3 maintained sources +paths-ignore: + - build + - docs/doxygen + - projects/Generated + diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..3024cb7c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1 + +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + - package-ecosystem: bazel + directory: / + schedule: + interval: weekly + diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index ea2b7bb5..4e45beb7 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,28 +1,26 @@ <!-- -Please do not submit pull requests changing the `version.hpp` -or the single-include `catch.hpp` file, these are changed -only when a new release is made. - -Before submitting a PR you should probably read the contributor documentation -at docs/contributing.md. It will tell you how to properly test your changes. +SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1 --> +## What changes -## Description -<!-- -Describe the what and the why of your pull request. Remember that these two -are usually a bit different. As an example, if you have made various changes -to decrease the number of new strings allocated, that's what. The why probably -was that you have a large set of tests and found that this speeds them up. ---> +Describe the test-framework behavior, compatibility surface, or build integration affected by this PR. -## GitHub Issues -<!-- -If this PR was motivated by some existing issues, reference them here. +## Upstream compatibility and provenance -If it is a simple bug-fix, please also add a line like 'Closes #123' -to your commit message, so that it is automatically closed. -If it is not, don't, as it might take several iterations for a feature -to be done properly. If in doubt, leave it open and reference it in the -PR itself, so that maintainers can decide. ---> +Explain whether the change preserves Catch2 compatibility or adds a Progmasoft-owned Catch3 feature. Identify copied +upstream code and its original license separately from new Progmasoft code. + +## Verification + +- [ ] SelfTest and relevant Progmasoft property/snapshot/XML tests were run. +- [ ] The affected Bazel, CMake, Meson, Xmake, or Premake build path was checked. +- [ ] Public headers and compiled-library behavior were considered; this PR does not accidentally make Catch3 header-only. +- [ ] I checked formatting, licenses, generated files, and `git diff --check`. + +Commands and results (including anything not run): + +```text + +``` diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..a9f409f0 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,33 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1 + +name: CodeQL +on: + push: + pull_request: + schedule: + - cron: '31 4 * * 1' +permissions: + actions: read + contents: read + security-events: write +jobs: + analyze: + name: ${{ matrix.language }} + runs-on: macos-15 + strategy: + fail-fast: false + matrix: + language: [actions, c-cpp] + steps: + - uses: actions/checkout@v7 + - uses: github/codeql-action/init@7999b86c43a865dc79d8923397f35af22de63401 # v4 + with: + languages: ${{ matrix.language }} + build-mode: none + config-file: ./.github/codeql/codeql-config.yml + queries: security-extended + - uses: github/codeql-action/analyze@7999b86c43a865dc79d8923397f35af22de63401 # v4 + with: + category: /language:${{ matrix.language }} + diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..4241f9a1 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,48 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1 + +name: Native coverage + +on: + push: + branches: [devel] + pull_request: + workflow_dispatch: + +permissions: + contents: read + id-token: write + +jobs: + clang: + runs-on: macos-latest + timeout-minutes: 40 + steps: + - uses: actions/checkout@v7 + - name: Configure Clang coverage build + run: >- + cmake --preset basic-tests -G Ninja + -DCMAKE_CXX_COMPILER=clang++ + -DCMAKE_CXX_FLAGS='-fprofile-instr-generate -fcoverage-mapping' + -DCMAKE_EXE_LINKER_FLAGS='-fprofile-instr-generate' + -DCMAKE_SHARED_LINKER_FLAGS='-fprofile-instr-generate' + - run: cmake --build build --parallel 4 --target SelfTest ProgmasoftSelfTest + - name: Run framework and Progmasoft tests + env: + LLVM_PROFILE_FILE: catch3-%p.profraw + run: ctest --test-dir build --output-on-failure -R '^(RunTests|Progmasoft::PropertyTests)$' + - name: Export LLVM source coverage + run: | + xcrun llvm-profdata merge -sparse build/tests/catch3-*.profraw -o catch3.profdata + xcrun llvm-cov export \ + -instr-profile=catch3.profdata \ + -format=lcov \ + build/tests/SelfTest \ + -object=build/tests/ProgmasoftSelfTest \ + > catch3.lcov + - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + with: + use_oidc: true + files: catch3.lcov + flags: catch3-native + fail_ci_if_error: true