Add proper help and default values for a number of the options #1357
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Static analysis | |
| on: | |
| pull_request: | |
| paths: | |
| - '**/*.cpp' | |
| - '**/*.hpp' | |
| - '**/*.c' | |
| - '**/*.h' | |
| - '**/CMakeLists.txt' | |
| - '**/*.cmake' | |
| - '**/.clang-tidy' | |
| - '.github/workflows/static-analysis-pr.yml' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: >- | |
| ${{ github.ref != 'refs/heads/master' && | |
| github.event_name != 'merge_group' && | |
| !startsWith(github.ref, 'refs/heads/gh-readonly-queue') }} | |
| permissions: | |
| contents: read | |
| packages: read | |
| jobs: | |
| clang-tidy: | |
| runs-on: ubuntu-24.04 | |
| container: | |
| image: ghcr.io/learning-process/ppc-ubuntu:1.1 | |
| credentials: | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: ccache | |
| uses: hendrikmuhs/[email protected] | |
| with: | |
| key: ${{ runner.os }}-clang | |
| create-symlink: true | |
| max-size: 1G | |
| - name: CMake configure | |
| run: > | |
| cmake -S . -B build -G Ninja | |
| -D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
| env: | |
| CC: clang-21 | |
| CXX: clang++-21 | |
| - name: Build project | |
| run: | | |
| cmake --build build --parallel -- --quiet | |
| env: | |
| CC: clang-21 | |
| CXX: clang++-21 | |
| - name: Show ccache stats | |
| run: ccache --show-stats | |
| - name: Run clang-tidy | |
| uses: ./.github/actions/clang-tidy-native | |
| id: review | |
| with: | |
| exclude: "3rdparty build" | |
| clang_tidy_version: "21" | |
| - if: steps.review.outputs.total_comments > 0 | |
| run: | | |
| echo "clang-tidy run has failed. See previous 'Run clang-tidy' stage logs" | |
| exit 1 | |
| clang-tidy-for-gcc-build: | |
| needs: | |
| - clang-tidy | |
| runs-on: ubuntu-24.04 | |
| container: | |
| image: ghcr.io/learning-process/ppc-ubuntu:1.1 | |
| credentials: | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: ccache | |
| uses: hendrikmuhs/[email protected] | |
| with: | |
| key: ${{ runner.os }}-gcc | |
| create-symlink: true | |
| max-size: 1G | |
| - name: CMake configure | |
| run: > | |
| cmake -S . -B build -G Ninja | |
| -D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
| env: | |
| CC: gcc-14 | |
| CXX: g++-14 | |
| - name: Build project | |
| run: | | |
| cmake --build build --parallel -- --quiet | |
| env: | |
| CC: gcc-14 | |
| CXX: g++-14 | |
| - name: Show ccache stats | |
| run: ccache --show-stats | |
| - name: Run clang-tidy | |
| uses: ./.github/actions/clang-tidy-native | |
| id: review | |
| with: | |
| exclude: "3rdparty build docs_venv .git .pytest_cache .ruff_cache xml" | |
| clang_tidy_version: "21" | |
| - if: steps.review.outputs.total_comments > 0 | |
| run: | | |
| echo "clang-tidy run has failed. See previous 'Run clang-tidy' stage logs" | |
| exit 1 | |
| nolint-check: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Search for linter suppression markers | |
| env: | |
| BASE_SHA: ${{ github.event.pull_request.base.sha }} | |
| HEAD_SHA: ${{ github.sha }} | |
| run: | | |
| set -euo pipefail | |
| CHANGED_FILES="$(git diff --name-only "$BASE_SHA"..."$HEAD_SHA" -- 'tasks/')" | |
| if [ -z "$CHANGED_FILES" ]; then | |
| echo "No changed files in tasks directory." | |
| exit 0 | |
| fi | |
| markers=( | |
| "NOLINT::Found 'NOLINT'" | |
| "IWYU[[:space:]]+pragma::Found 'IWYU pragma'" | |
| "LCOV_EXCL_START::Found 'LCOV_EXCL_START'" | |
| "LCOV_EXCL_STOP::Found 'LCOV_EXCL_STOP'" | |
| "GCOVR_EXCL_LINE::Found 'GCOVR_EXCL_LINE'" | |
| "GCOVR_EXCL_START::Found 'GCOVR_EXCL_START'" | |
| "GCOVR_EXCL_STOP::Found 'GCOVR_EXCL_STOP'" | |
| ) | |
| for file in $CHANGED_FILES; do | |
| for marker in "${markers[@]}"; do | |
| pattern="${marker%%::*}" | |
| message="${marker#*::}" | |
| if grep -Eq "$pattern" "$file"; then | |
| echo "::error::${message} in $file." | |
| exit 1 | |
| fi | |
| done | |
| done | |
| echo "No linter suppression markers found in changed files." |