-
Notifications
You must be signed in to change notification settings - Fork 40
36 lines (30 loc) · 1.23 KB
/
c-linter.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: cpp-linter
on: [pull_request]
jobs:
cpp-linter:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get -qq -y install curl clang-tidy cmake jq clang cppcheck clang-format bear g++>=9.3.0 gfortran>=9.3.0
- name: Get cpp linter repo
run: |
cd Submodules
git clone https://github.com/dwillcox/cpp-linter-action.git
cd ..
- name: Check header includes
run: |
echo 'HEADER_INCLUDES=$(grep -rIE --include="*.cpp" --include="*.H" --exclude-dir=Submodules "#\s?include\s+\"\w+\.\w+\"")' >> $GITHUB_ENV
echo $HEADER_INCLUDES
if [[ -n "${HEADER_INCLUDES}" ]]; then exit 1; fi
- name: Run cpp linter
run: python3 Submodules/cpp-linter-action/run_on_changed_files.py ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} -header-filter=Source/ -ignore-files="AMReX|GoogleTest" -run-linter
- name: Archive clang tidy report
uses: actions/upload-artifact@v4
with:
name: clang-tidy-report
path: clang-tidy-report.txt