Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
HeaderFilterRegex: ''
Checks: '
bugprone-*,
concurrency-*,
cppcoreguidelines-*,
modernize-*,
portability-*,
readability-*,
-bugprone-easily-swappable-parameters,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-unchecked-optional-access,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-modernize-use-nodiscard,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-magic-numbers,
-readability-math-missing-parentheses,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-owning-memory
'
FormatStyle: none
70 changes: 66 additions & 4 deletions .github/workflows/linux-eic-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
clang-tidy-CXX: clang++

jobs:

build:
Expand All @@ -20,21 +23,80 @@ jobs:
fail-fast: false
matrix:
include:
- { cc: gcc, cxx: g++ }
- { cc: clang, cxx: clang++ }
- { cc: gcc, cxx: g++, build_type: Release }
- { cc: clang, cxx: clang++, build_type: Release }
- { cc: clang, cxx: clang++, build_type: Debug }
steps:
- uses: actions/checkout@v3
- uses: cvmfs-contrib/github-action-cvmfs@v5
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "eic_xl:nightly"
run: |
CC=${{matrix.cc}} CXX=${{matrix.cxx}} cmake -S . -B build -DDELPHES=ON -DEVALUATION=OFF -DCMAKE_INSTALL_PREFIX=install
CC=${{matrix.cc}} CXX=${{matrix.cxx}} cmake -S . -B build -DDELPHES=ON -DEVALUATION=OFF -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
cmake --build build
cmake --install build
- name: Compress build directory
if: matrix.cxx == env.clang-tidy-CXX && matrix.build_type == 'Debug'
run: tar -caf build.tar.zst build/
- name: Upload build directory
if: matrix.cxx == env.clang-tidy-CXX && matrix.build_type == 'Debug'
uses: actions/upload-artifact@v4
with:
name: build_${{matrix.cc}}_${{matrix.build_type}}
path: build.tar.zst
retention-days: 1
if-no-files-found: error
- uses: actions/upload-artifact@v4
with:
name: install_${{matrix.cc}}
name: install_${{matrix.cc}}_${{matrix.build_type}}
path: install
retention-days: 1
if-no-files-found: error

clang-tidy:
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: cvmfs-contrib/github-action-cvmfs@v5
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build_clang_Debug
path: .
- name: Uncompress build artifact
run: tar -xaf build.tar.zst
- name: Run clang-tidy on changed files
uses: eic/run-cvmfs-osg-eic-shell@main
if: ${{ github.event_name == 'pull_request' }}
with:
platform-release: "eic_xl:nightly"
run: |
git diff ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | clang-tidy-diff -p 1 -path build -quiet -export-fixes clang_tidy_fixes.yaml
- name: Run clang-tidy on all files
uses: eic/run-cvmfs-osg-eic-shell@main
if: ${{ github.event_name == 'push' }}
with:
platform-release: "eic_xl:nightly"
run: |
run-clang-tidy -p build -export-fixes clang_tidy_fixes.yaml
- name: Upload clang-tidy fixes as artifact
uses: actions/upload-artifact@v4
with:
name: clang-tidy-fixes.yaml
path: clang_tidy_fixes.yaml
if-no-files-found: ignore
- name: Suggest clang-tidy fixes as PR comments
uses: platisd/clang-tidy-pr-comments@v1.8.0
if: ${{ github.event_name == 'pull_request' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
clang_tidy_fixes: clang_tidy_fixes.yaml
request_changes: false
suggestions_per_comment: 10