Skip to content

Push capable #14

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

Merged
merged 60 commits into from
Aug 22, 2021
Merged

Push capable #14

merged 60 commits into from
Aug 22, 2021

Conversation

2bndy5
Copy link
Collaborator

@2bndy5 2bndy5 commented Aug 22, 2021

Properly resolves #8
Also resolves #6

  • source files are only downloaded if the action (run in the repo's root directory) cannot find the changed file.
  • added a new user input called repo-root that allows user to specify a relative path. This makes the action change its working directory to whatever folder the user git checkout their source code to.
    • testing has shown that using the actions/checkout action from GH yields faster results when this action doesn't need to download the source files.
  • bot comments are now augmented so that they include output from clang-tidy and clang-format.
    Observe 2bndy5@f26cabc#commitcomment-55219273 as an example. Incidentally, that commit comment is added to this PR's comments.
    • I did this because it seemed like a bug in the original script was preventing both outputs from showing in the bot's posted comment.
  • added a new user input called tidy-checks to allow specifying a different set of checks passed to clang-tidy. By setting this input to '', this allows users to make clang-tidy use either the default checks or only whatever checks are specified in an optionally accompanied .clang-tidy config file.
  • the READEME updates in this PR do not include the README changes from #8 update readme to suggest open push event by default #9. So, that PR can be merged after this gets merged into it.
  • For the benefit of prospecting contributors, I've segregated the run_checks.sh script into byte-sized functions and added comments for anything that isn't completely obvious.
  • added a .gitattributes file to ensure the bash script file consistently uses Unix LF instead of letting windows-based developers contribute illegal CRLF into the bash script.
  • Docker file uses FROM shenxianpeng/clang-tool:10 for behavior consistent with older releases of this action. This too will change as we move to solve Support different versions of clang-format and clang-tidy clang-tools-docker#1

2bndy5 and others added 30 commits August 20, 2021 15:25
* solution for cpp-linter#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

Co-authored-by: shenxianpeng <xianpeng.shen@gmail.com>
This reverts commit fbbb1b5a6f8a80f8d4245ebce07d7048ff74fedd.
@shenxianpeng
Copy link
Collaborator

Your changes look so awesome, I can’t wait to merge them.

@2bndy5
Copy link
Collaborator Author

2bndy5 commented Aug 22, 2021

Please hold. I'm integrating the new docker image... (& adding the corresponding user input)

@2bndy5
Copy link
Collaborator Author

2bndy5 commented Aug 22, 2021

Ok, the new image checks out. It did seem to take longer to set up, but its still about 1.5 minutes faster than the other clang-tidy actions on the GH marketplace that also support all available versions.

I also added (un-commented) the user option to specify a version in the action.yml

@shenxianpeng shenxianpeng merged commit bdb5877 into cpp-linter:update-readme Aug 22, 2021
@shenxianpeng shenxianpeng added the enhancement New feature or request label Aug 22, 2021
shenxianpeng added a commit that referenced this pull request Aug 22, 2021
* #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>
@shenxianpeng
Copy link
Collaborator

We are pretty fast 😃 see from actions: now it takes 2m 17s than before 55s.

@2bndy5
Copy link
Collaborator Author

2bndy5 commented Aug 22, 2021

yep that one other action that uses primarily python to create automatic reviews takes about 3m 35s to build the action's image and then about another 1m 30s to execute the action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants