Skip to content

Commit bc9fd05

Browse files
committed
test: e2e cpp-linter-action v3.0.0-rc0 with cpp-linter v2 rc
1 parent 25749b7 commit bc9fd05

2 files changed

Lines changed: 150 additions & 0 deletions

File tree

‎.github/workflows/v3-e2e.yml‎

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: v3.0.0-rc0 e2e
2+
3+
on:
4+
push:
5+
branches: [claude/project-thread-3y9j3l]
6+
pull_request:
7+
branches: [master]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
# Cross-platform smoke test: v3.0.0-rc0 vs v2 on the same commit.
14+
matrix:
15+
if: github.event_name == 'push'
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest, windows-11-arm]
20+
version: ['21']
21+
action: [v3]
22+
include:
23+
- { os: ubuntu-latest, version: '12', action: v3 }
24+
- { os: ubuntu-latest, version: '17', action: v3 }
25+
- { os: ubuntu-latest, version: '23', action: v3 }
26+
- { os: ubuntu-latest, version: '21', action: v2 }
27+
- { os: macos-latest, version: '21', action: v2 }
28+
- { os: windows-latest, version: '21', action: v2 }
29+
runs-on: ${{ matrix.os }}
30+
steps:
31+
- uses: actions/checkout@v7
32+
with:
33+
persist-credentials: false
34+
- name: Generate compilation database
35+
run: cmake -B build -S src -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
36+
- name: cpp-linter-action v3.0.0-rc0
37+
if: matrix.action == 'v3'
38+
id: v3
39+
uses: cpp-linter/cpp-linter-action@v3.0.0-rc0
40+
env:
41+
GITHUB_TOKEN: ${{ github.token }}
42+
with:
43+
style: file
44+
files-changed-only: false
45+
ignore: build
46+
database: build
47+
version: ${{ matrix.version }}
48+
step-summary: true
49+
extra-args: -std=c++14 -Wall
50+
- name: cpp-linter-action v2
51+
if: matrix.action == 'v2'
52+
id: v2
53+
uses: cpp-linter/cpp-linter-action@v2
54+
env:
55+
GITHUB_TOKEN: ${{ github.token }}
56+
with:
57+
style: file
58+
files-changed-only: false
59+
ignore: build
60+
database: build
61+
version: ${{ matrix.version }}
62+
step-summary: true
63+
extra-args: -std=c++14 -Wall
64+
- name: Outputs
65+
shell: bash
66+
run: |
67+
echo "${{ matrix.action }} ${{ matrix.os }} clang ${{ matrix.version }}: total=${{ steps.v3.outputs.checks-failed }}${{ steps.v2.outputs.checks-failed }} format=${{ steps.v3.outputs.clang-format-checks-failed }}${{ steps.v2.outputs.clang-format-checks-failed }} tidy=${{ steps.v3.outputs.clang-tidy-checks-failed }}${{ steps.v2.outputs.clang-tidy-checks-failed }}" | tee -a "$GITHUB_STEP_SUMMARY"
68+
69+
# Only the deprecated alias is set: a review is expected if the alias works.
70+
pr-alias:
71+
if: github.event_name == 'pull_request'
72+
runs-on: ubuntu-latest
73+
permissions:
74+
contents: read
75+
pull-requests: write
76+
steps:
77+
- uses: actions/checkout@v7
78+
with:
79+
persist-credentials: false
80+
- run: cmake -B build -S src -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
81+
- uses: cpp-linter/cpp-linter-action@v3.0.0-rc0
82+
id: linter
83+
env:
84+
GITHUB_TOKEN: ${{ github.token }}
85+
with:
86+
style: file
87+
lines-changed-only: true
88+
ignore: build
89+
database: build
90+
tidy-review: true
91+
file-annotations: false
92+
extra-args: -std=c++14 -Wall
93+
- run: echo "alias run done at $(date -u +%FT%TZ), checks-failed=${{ steps.linter.outputs.checks-failed }}" | tee -a "$GITHUB_STEP_SUMMARY"
94+
95+
pr-review:
96+
needs: pr-alias
97+
if: always() && github.event_name == 'pull_request'
98+
runs-on: ubuntu-latest
99+
permissions:
100+
contents: read
101+
pull-requests: write
102+
steps:
103+
- uses: actions/checkout@v7
104+
with:
105+
persist-credentials: false
106+
- run: cmake -B build -S src -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
107+
- uses: cpp-linter/cpp-linter-action@v3.0.0-rc0
108+
id: linter
109+
env:
110+
GITHUB_TOKEN: ${{ github.token }}
111+
with:
112+
style: file
113+
lines-changed-only: true
114+
ignore: build
115+
database: build
116+
pr-review: true
117+
thread-comments: update
118+
step-summary: true
119+
extra-args: -std=c++14 -Wall
120+
- run: echo "pr-review done at $(date -u +%FT%TZ), checks-failed=${{ steps.linter.outputs.checks-failed }}" | tee -a "$GITHUB_STEP_SUMMARY"
121+
122+
# Runs after the review jobs so a pushed fix cannot move their diff mid-run.
123+
auto-fix:
124+
needs: pr-review
125+
if: always() && github.event_name == 'pull_request'
126+
runs-on: ubuntu-latest
127+
permissions:
128+
contents: write
129+
steps:
130+
- uses: actions/checkout@v7
131+
- run: cmake -B build -S src -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
132+
- uses: cpp-linter/cpp-linter-action@v3.0.0-rc0
133+
id: linter
134+
env:
135+
GITHUB_TOKEN: ${{ github.token }}
136+
with:
137+
style: file
138+
lines-changed-only: true
139+
ignore: build
140+
database: build
141+
auto-fix: true
142+
file-annotations: false
143+
extra-args: -std=c++14 -Wall
144+
- name: State after auto-fix
145+
run: |
146+
git log --oneline -3
147+
git status --short
148+
ls -la .cpp-linter-cache || true

‎src/demo.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ int main()
1515

1616
return 0;
1717
}
18+
19+
int addedForV3Test(int x){return x*2;}

0 commit comments

Comments
 (0)