Skip to content

Commit 0c2565e

Browse files
committed
Add linter analysis workflow
1 parent 7a7d44d commit 0c2565e

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/analysis.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: cpp-linter-analysis
2+
3+
on: [push, pull_request]
4+
5+
defaults:
6+
run:
7+
shell: bash -e -l {0}
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-24.04
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
# Set up Clang and LLVM
18+
- name: Set up Clang
19+
uses: llvm/actions/setup-clang@v2
20+
with:
21+
clang-version: 20
22+
23+
# Set conda environment using setup-micromamba
24+
- name: Set conda environment
25+
uses: mamba-org/setup-micromamba@main
26+
with:
27+
environment-name: myenv
28+
environment-file: environment-dev.yml
29+
init-shell: bash
30+
cache-downloads: true
31+
32+
# Run CMake configuration
33+
- name: Configure using CMake
34+
run: |
35+
cmake -G Ninja \
36+
-Bbuild \
37+
-DCMAKE_BUILD_TYPE=Release \
38+
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
39+
-DBUILD_TESTS=ON \
40+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
41+
#-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING
42+
43+
# Run Clang-Tidy and Clang-Format Analysis
44+
- name: Run C++ analysis
45+
uses: cpp-linter/cpp-linter-action@v2
46+
id: linter
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
with:
50+
version: 20
51+
files-changed-only: false # check all files
52+
database: 'build'
53+
style: 'file' # Use .clang-format config file
54+
tidy-checks: '' # Use .clang-tidy config file
55+
step-summary: true
56+
ignore: 'build'
57+
extra-args: '-std=c++20'

0 commit comments

Comments
 (0)