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
I wanted to post this in discussions but it's not enabled for the repo.
Here's how I am able to run the clang-tidy review script directly on the github runner environments without needing the ubuntu container.
Why would you do this?
Saves time spent each run fetching the docker and installing packages with apt
You can take better advantage of github caches
You can run this on any of the runners that github provides or that you host yourself.
This works on different CI workflows than github actions
You can use any version of clang-tidy that is available to you in this environment.
Overall seems to run much faster
name: Clang Tidyon:
pull_request_target: # Required to post comments on PR from forksjobs:
clang-tidy-review:
runs-on: ubuntu-latestif: startsWith(github.event_name, 'pull_request') # Posting a review only makes sense on PRssteps:
# Repo config for pull_request_target
- uses: actions/checkout@v3with:
ref: ${{ github.event.pull_request.head.ref }}repository: ${{ github.event.pull_request.head.repo.full_name }}submodules: recursive# Generate compilation database and make sure to have the source and all third party headers available# Checkout the review source for the python package
- name: Checkout clang-tidy-reviewuses: actions/checkout@v4with:
repository: ZedThree/clang-tidy-reviewref: masterpath: clang-tidy-review
- name: Install LLVM and Clanguses: KyleMayes/install-llvm-action@v2with:
version: '17'
- uses: actions/setup-python@v5with:
python-version: '3.12'cache: 'pip'# Install the python package and run review
- name: Non-docker clang-tidy-checkrun: | clang-tidy --version pip install ${{github.workspace}}/clang-tidy-review/post/clang_tidy_review review --token=${{ secrets.GITHUB_TOKEN }} --repo=${{ github.event.pull_request.head.repo.full_name }} --pr=${{ github.event.pull_request.number }} --clang_tidy_binary=clang-tidy --build_dir=cmake-build-presets/ninja-multi-vcpkg --config_file=.clang-tidy --split_workflow=Trueenv:
USER: ${{ github.event.pull_request.user.login }}# Upload the review for the next job
- uses: actions/upload-artifact@v3with:
name: ClangTidyReviewOutputs-${{matrix.os}}path: | clang-tidy-review-metadata.json clang-tidy-review-output.json clang_tidy_review.yaml# Second part of the split jobclang-tidy-comments:
runs-on: ubuntu-latestneeds: clang-tidy-reviewsteps:
- name: Checkout clang-tidy-reviewuses: actions/checkout@v4with:
repository: ZedThree/clang-tidy-reviewref: masterpath: clang-tidy-review# Download all the reviews
- uses: actions/download-artifact@v3with:
name: ClangTidyReviewOutputs-ubuntu-latestpath: ubuntu-latest
- uses: actions/download-artifact@v3with:
name: ClangTidyReviewOutputs-macos-latestpath: macos-latest
- uses: actions/download-artifact@v3with:
name: ClangTidyReviewOutputs-windows-latestpath: windows-latest
- uses: actions/setup-python@v5with:
python-version: '3.12'cache: 'pip'# Again install and run the python package to post the review
- name: Non-docker clang-tidy-checkrun: | clang-tidy --version pip install ${{github.workspace}}/clang-tidy-review/post/clang_tidy_review cp ubuntu-latest/clang-tidy-review-metadata.json . post --token=${{ secrets.GITHUB_TOKEN }} --repo=${{ github.event.pull_request.head.repo.full_name }} ubuntu-latest/clang-tidy-review-output.json macos-latest/clang-tidy-review-output.json windows-latest/clang-tidy-review-output.json
The text was updated successfully, but these errors were encountered:
I initially used also clang-tidy-review but ended up creating my own that works almost the same as this one for the reasons you just pointed out, you can check it out here https://github.com/ZehMatt/clang-tidy-annotations
I hope this doesn't come over as self advertisement but I figured this is exactly what this issue is about.
Thanks for sharing!
Correct me if I'm wrong but annotations don't give you the option to add fixes to a batch in the PR's web interface, is that right?
I wanted to post this in discussions but it's not enabled for the repo.
Here's how I am able to run the clang-tidy review script directly on the github runner environments without needing the ubuntu container.
Why would you do this?
apt
The text was updated successfully, but these errors were encountered: