Repository navigation
test: e2e cpp-linter-action v3.0.0-rc0 with cpp-linter rc.25 #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,174 @@ | ||
| name: v3.0.0-rc0 e2e (cpp-linter rc.25) | ||
|
|
||
| on: | ||
| push: | ||
| branches: [claude/project-thread-1yllzi] | ||
| pull_request: | ||
| branches: [master] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| # Cross-platform smoke test: v3.0.0-rc0 vs v2 on the same commit. | ||
| matrix: | ||
| if: github.event_name == 'push' | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest, windows-11-arm] | ||
| version: ['21'] | ||
| action: [v3] | ||
| include: | ||
| - { os: ubuntu-latest, version: '12', action: v3 } | ||
| - { os: ubuntu-latest, version: '17', action: v3 } | ||
| - { os: ubuntu-latest, version: '23', action: v3 } | ||
| - { os: ubuntu-latest, version: '21', action: v2 } | ||
| - { os: macos-latest, version: '21', action: v2 } | ||
| - { os: windows-latest, version: '21', action: v2 } | ||
| # No database and no extra-args: the action passes empty path values. | ||
| - { os: ubuntu-latest, version: '21', action: v3-empty } | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Generate compilation database | ||
| run: cmake -B build -S src -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | ||
| - name: cpp-linter-action v3.0.0-rc0 | ||
| if: matrix.action == 'v3' | ||
| id: v3 | ||
| uses: cpp-linter/[email protected] | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| with: | ||
| # Workaround: rc.25 rejects the empty value the action passes when unset. | ||
| summary-output-file: cpp-linter-summary-${{ github.job }}.md | ||
| style: file | ||
| files-changed-only: false | ||
| ignore: build | ||
| database: build | ||
| version: ${{ matrix.version }} | ||
| step-summary: true | ||
| extra-args: -std=c++14 -Wall | ||
| - name: cpp-linter-action v3.0.0-rc0, empty path inputs | ||
| if: matrix.action == 'v3-empty' | ||
| id: v3e | ||
| uses: cpp-linter/[email protected] | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| with: | ||
| # Workaround: rc.25 rejects the empty value the action passes when unset. | ||
| summary-output-file: cpp-linter-summary-${{ github.job }}.md | ||
| style: file | ||
| files-changed-only: false | ||
| ignore: build | ||
| version: ${{ matrix.version }} | ||
| step-summary: true | ||
| - name: cpp-linter-action v2 | ||
| if: matrix.action == 'v2' | ||
| id: v2 | ||
| uses: cpp-linter/cpp-linter-action@v2 | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| with: | ||
| style: file | ||
| files-changed-only: false | ||
| ignore: build | ||
| database: build | ||
| version: ${{ matrix.version }} | ||
| step-summary: true | ||
| extra-args: -std=c++14 -Wall | ||
| - name: Outputs | ||
| shell: bash | ||
| run: | | ||
| echo "${{ matrix.action }} ${{ matrix.os }} clang ${{ matrix.version }}: total=${{ steps.v3.outputs.checks-failed }}${{ steps.v3e.outputs.checks-failed }}${{ steps.v2.outputs.checks-failed }} format=${{ steps.v3.outputs.clang-format-checks-failed }}${{ steps.v3e.outputs.clang-format-checks-failed }}${{ steps.v2.outputs.clang-format-checks-failed }} tidy=${{ steps.v3.outputs.clang-tidy-checks-failed }}${{ steps.v3e.outputs.clang-tidy-checks-failed }}${{ steps.v2.outputs.clang-tidy-checks-failed }}" | tee -a "$GITHUB_STEP_SUMMARY" | ||
|
|
||
| # Only the deprecated alias is set: a review is expected if the alias works. | ||
| pr-alias: | ||
| if: github.event_name == 'pull_request' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| with: | ||
| persist-credentials: false | ||
| - run: cmake -B build -S src -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | ||
| - uses: cpp-linter/[email protected] | ||
| id: linter | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| with: | ||
| # Workaround: rc.25 rejects the empty value the action passes when unset. | ||
| summary-output-file: cpp-linter-summary-${{ github.job }}.md | ||
| style: file | ||
| lines-changed-only: true | ||
| ignore: build | ||
| database: build | ||
| tidy-review: true | ||
| file-annotations: false | ||
| extra-args: -std=c++14 -Wall | ||
| - run: echo "alias run done at $(date -u +%FT%TZ), checks-failed=${{ steps.linter.outputs.checks-failed }}" | tee -a "$GITHUB_STEP_SUMMARY" | ||
|
|
||
| pr-review: | ||
| needs: pr-alias | ||
| if: always() && github.event_name == 'pull_request' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| with: | ||
| persist-credentials: false | ||
| - run: cmake -B build -S src -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | ||
| - uses: cpp-linter/[email protected] | ||
| id: linter | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| with: | ||
| # Workaround: rc.25 rejects the empty value the action passes when unset. | ||
| summary-output-file: cpp-linter-summary-${{ github.job }}.md | ||
| style: file | ||
| lines-changed-only: true | ||
| ignore: build | ||
| database: build | ||
| pr-review: true | ||
| thread-comments: update | ||
| step-summary: true | ||
| extra-args: -std=c++14 -Wall | ||
| - name: Summary output file | ||
| run: test -s cpp-linter-summary-pr-review.md && head -20 cpp-linter-summary-pr-review.md | ||
| - run: echo "pr-review done at $(date -u +%FT%TZ), checks-failed=${{ steps.linter.outputs.checks-failed }}" | tee -a "$GITHUB_STEP_SUMMARY" | ||
|
|
||
| # Runs after the review jobs so a pushed fix cannot move their diff mid-run. | ||
| auto-fix: | ||
| needs: pr-review | ||
| if: always() && github.event_name == 'pull_request' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| - run: cmake -B build -S src -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | ||
| - uses: cpp-linter/[email protected] | ||
| id: linter | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| with: | ||
| # Workaround: rc.25 rejects the empty value the action passes when unset. | ||
| summary-output-file: cpp-linter-summary-${{ github.job }}.md | ||
| style: file | ||
| lines-changed-only: true | ||
| ignore: build | ||
| database: build | ||
| auto-fix: true | ||
| file-annotations: false | ||
| extra-args: -std=c++14 -Wall | ||
| - name: State after auto-fix | ||
| run: | | ||
| git log --oneline -3 | ||
| git status --short | ||
| ls -la .cpp-linter-cache || true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,19 @@ | ||
| /** This is a very ugly test code (doomed to fail linting) */ | ||
| #include "demo.hpp" | ||
|
Check warning on line 2 in src/demo.cpp
|
||
| #include <cstdio> | ||
|
Check failure on line 3 in src/demo.cpp
|
||
| #include <cstddef> | ||
|
|
||
| // using size_t from cstddef | ||
| size_t dummyFunc(size_t i) { return i; } | ||
|
Check warning on line 7 in src/demo.cpp
|
||
|
|
||
| int main() | ||
|
Check warning on line 9 in src/demo.cpp
|
||
| { | ||
| for (;;) | ||
|
Check warning on line 11 in src/demo.cpp
|
||
| break; | ||
|
|
||
| printf("Hello world!\n"); | ||
|
Check warning on line 14 in src/demo.cpp
|
||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| int addedForV3Test(int x){return x*2;} | ||
|
Check warning on line 19 in src/demo.cpp
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy diagnostic(s)
clang-tidy diagnostic
src/demo.cpp:19:25 warning: [readability-identifier-length]