You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#8 update readme to suggest open push event by default (#9)
* #8 update readme to suggest open push event by default
* Push capable (#14)
* Output exit code (#10)
* solution for #7
* parameterize EXIT_CODE
* fix bash function calls; switch to the new docker image
* fix bash array length syntax
* oops need that apt update
* ok now change the test code a bit
* check output is working
* fix bad yml syntax
* is it being set at all?
* use a string instead of an integer
* fix bash logic syntax
* single square brackets are the old way to do logic
* review changes
* add output var info to the readme
* Update demo.cpp
* Revert action to upstream master
* fix dockerfile from image not exist
* solution for #7
* parameterize EXIT_CODE
* fix bash function calls; switch to new docker image
* check output is working
* show me some env vars
* trigger on push events
* switch action to push-capable branch
* echo the JSON that lives on the runner
* use cat instead of echo
* remove backticks
* use alpine while debugging git events
* Revert "use alpine while debugging git events"
This reverts commit fbbb1b5a6f8a80f8d4245ebce07d7048ff74fedd.
* test push compatibility
* provide version input
* docker uses tags
* oops update run_checks.sh
* fix jq args on push
* test push src change
* test src change w/ GH checkout
* fix filename output for push events (w/ checkouts)
* test new comment body
* gotta break that bad habit
* check against src change
* use sed directly instead of sed then cat
* tidy docs lied
* don't know why sed isn't working
* try multiple ARG options
* try to replace the docker file
* maybe without dyn var
* bad domain?
* nope needs a docker:// domain
* reverting changes to docker file FROM
* fix clang-format output to file
* test on src changes
* list clang-fmt warnings per file
* add demo.h and adjust comment body
* make test action use default extensions
* don't checkout repo on test action
* stay in working dir. DL into a hidden file
* organize output better
* adjust output again
* fix output; switch back to checkout repo
* enforce CPP syntax in the filename (no checkout)
* sed taking too much out of the path in clang-tidy out
* that's better (checkout is faster)
* segregate script into functions
* oops uncomment from debugging locally
* show me a long diff
* show me a split diff
* clean-up (ready for PR)
* update readme
* remove the version from user inputs
* only apply clang-tidy checks if it was specified
* switch test action back to upstream
* add version for user input
Co-authored-by: Brendan <2bndy5@gmail.com>
Copy file name to clipboardExpand all lines: README.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,12 +6,13 @@ Github Actions for linting the C/C++ code. Integrated clang-tidy, clang-format c
6
6
7
7
Just create a `yml` file under your GitHub repository. For example `.github/workflows/cpp-linter.yml`
8
8
9
-
!!! Requires `secrets.GITHUB_TOKEN` set to an environment variable name "GITHUB_TOKEN".
9
+
!!! Requires `secrets.GITHUB_TOKEN` set to an environment variable named `GITHUB_TOKEN`.
10
10
11
11
```yml
12
12
name: cpp-linter
13
13
14
-
on: [pull_request]
14
+
# Triggers the workflow on push or pull request events
15
+
on: [push, pull_request]
15
16
jobs:
16
17
cpp-linter:
17
18
name: cpp-linter
@@ -30,6 +31,13 @@ jobs:
30
31
|------------|---------------|-------------|
31
32
| style | 'llvm' | The style rules to use. Set this to 'file' to have clang-format use the closest relative .clang-format file. |
32
33
| extensions | 'c,h,C,H,cpp,hpp,cc,hh,c++,h++,cxx,hxx' | The file extensions to run the action against. This is a comma-separated string. |
34
+
| tidy-checks | 'boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-*,cppcoreguidelines-*' | A string of regex-like patterns specifying what checks clang-tidy will use.|
35
+
| repo-root | '.' | The relative path to the repository root directory. This path is relative to path designated by the runner's GITHUB_WORKSPACE environment variable. |
36
+
| version | '10' | The desired version of the clang tools to use. Accepted options are strings which can be 6.0, 7, 8, 9, 10, 11, 12. |
37
+
38
+
### Outputs
39
+
40
+
This action creates 1 output variable named `checks-failed`. Even if the linting checks fail for source files this action will still pass, but users' CI workflows can use this action's output to exit the workflow early if that is desired.
Copy file name to clipboardExpand all lines: action.yml
+25-3Lines changed: 25 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,33 @@ branding:
5
5
icon: 'check-circle'
6
6
color: 'green'
7
7
inputs:
8
-
style: # the specific style rules
9
-
description: "The style rules to use (defaults to 'llvm'). Set this to 'file' to have clang-format use the closest relative .clang-format file."
8
+
style:
9
+
description: >
10
+
The style rules to use (defaults to 'llvm').
11
+
Set this to 'file' to have clang-format use the closest relative .clang-format file.
10
12
required: false
11
13
default: 'llvm'
12
14
extensions:
13
-
description: "The file extensions to run the action against. This comma-separated string defaults to 'c,h,C,H,cpp,hpp,cc,hh,c++,h++,cxx,hxx'."
15
+
description: >
16
+
The file extensions to run the action against.
17
+
This comma-separated string defaults to 'c,h,C,H,cpp,hpp,cc,hh,c++,h++,cxx,hxx'.
14
18
required: false
15
19
default: "c,h,C,H,cpp,hpp,cc,hh,c++,h++,cxx,hxx"
20
+
tidy-checks:
21
+
description: >
22
+
A string of regex-like patterns specifying what checks clang-tidy will use.
23
+
This defaults to 'boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-*,cppcoreguidelines-*'. See also clang-tidy docs for more info.
0 commit comments