Skip to content

Commit db4da93

Browse files
authored
plugin: add CI with lint
2 parents e78e2fa + 4b5bc67 commit db4da93

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: clang-format check
2+
description: Checks formatting using clang-format
3+
4+
inputs:
5+
source-dir:
6+
description: 'Root directory of the cpp project'
7+
required: false
8+
default: '.'
9+
10+
runs:
11+
using: composite
12+
steps:
13+
- name: Install clang-format
14+
shell: bash
15+
run: sudo apt-get install -y clang-format
16+
17+
- name: Run clang-format
18+
shell: bash
19+
run: |
20+
find ${{ inputs.source-dir }}/src ${{ inputs.source-dir }}/tests \
21+
-name '*.cpp' -o -name '*.h' | \
22+
xargs clang-format --dry-run --Werror

.github/workflows/plugin-ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Plugin CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'plugin/**'
8+
- '.github/**'
9+
pull_request:
10+
paths:
11+
- 'plugin/**'
12+
- '.github/**'
13+
14+
jobs:
15+
lint:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Check formatting
22+
uses: ./.github/actions/plugin/lint
23+
with:
24+
source-dir: plugin

plugin/.clang-format

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
BasedOnStyle: Google
22
IndentWidth: 4
3-
ColumnLimit: 120
3+
ColumnLimit: 120
4+
Standard: c++20

0 commit comments

Comments
 (0)