Test new pr review #329
This file contains 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: cpp-linter as pkg | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'which branch to test' | |
default: 'hide-reuse-pr-reviews' | |
required: true | |
pull_request: | |
jobs: | |
cpp-linter: | |
name: cpp-linter job | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
clang-version: ['17'] #['7', '8', '9','10', '11', '12', '13', '14', '15', '16', '17'] | |
repo: ['cpp-linter/cpp-linter'] | |
branch: | |
- ${{ github.event_name == 'workflow_dispatch' && inputs.branch || 'hide-reuse-pr-reviews' }} | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- name: Install workflow deps | |
run: python -m pip install clang-tools git+https://github.com/${{ matrix.repo }}/@${{ matrix.branch }} | |
- name: Install clang-tools | |
run: clang-tools --install ${{ matrix.clang-version }} --directory ${{ runner.temp }}/llvm | |
- name: Setup VS dev env | |
uses: TheMrMilchmann/setup-msvc-dev@v3 | |
with: | |
arch: x64 | |
- name: Cache the build artifacts | |
id: cache-build | |
uses: actions/cache@v4 | |
with: | |
path: build | |
key: ${{ hashFiles('src/CMakeLists.txt', 'src/demo.cpp', 'src/demo.hpp') }} | |
- name: Generate compiler database | |
if: steps.cache-build.outputs.cache-hit != 'true' | |
run: mkdir build && cmake -Bbuild src -G "NMake Makefiles" | |
- name: Run linter as package | |
id: linter | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: > | |
cpp-linter | |
-s=file | |
-v=debug | |
-i=build | |
-p=build | |
-V=${{ runner.temp }}/llvm | |
-f=false | |
--extra-arg="-std=c++14 -Wall" | |
--thread-comments=${{ matrix.clang-version == '17' && 'update' }} | |
-a=false | |
--tidy-review=${{ matrix.clang-version == '17' }} | |
--format-review=${{ matrix.clang-version == '17' }} | |
--step-summary=true | |
- name: Fail fast?! | |
if: steps.linter.outputs.checks-failed > 0 | |
run: | | |
echo "checks-failed: ${{ steps.linter.outputs.checks-failed }}" | |
echo "clang-tidy-checks-failed: ${{ steps.linter.outputs.clang-tidy-checks-failed }}" | |
echo "clang-format-checks-failed: ${{ steps.linter.outputs.clang-format-checks-failed }}" | |
# for actual deployment | |
# run: exit 1 |