Skip to content

Commit a088b47

Browse files
committed
Adjust folder structure in clang-tidy GH action
1 parent 6af7b61 commit a088b47

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

.github/workflows/clang-tidy.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,12 @@ jobs:
2020

2121
# Scan these roots for *.cpp
2222
INCLUDE_DIRS: |
23-
.
23+
src
2424
2525
# Exclude these folders (repo-root relative).
2626
# Tip: list the folder roots; the step adds '/*' for you.
2727
EXCLUDE_DIRS: |
28-
tests
29-
docs
30-
.vs
31-
.github
32-
.git
28+
src/tests
3329
3430
steps:
3531
- name: Checkout
@@ -42,10 +38,24 @@ jobs:
4238
sudo apt-get update
4339
sudo apt-get install -y clang-tidy clang cmake ninja-build python3-yaml lcov
4440
41+
- name: Reorganize sources for clang-tidy
42+
run: |
43+
mkdir src
44+
# Move ONLY your two real source files into src
45+
mv tinyexpr.cpp src/
46+
mv tinyexpr.h src/ 2>/dev/null || true # if it exists
47+
48+
# Move the whole tests folder under src/
49+
mv tests src/
50+
51+
# Recreate symlinks so CMake can still find files at their old locations
52+
ln -s src/tinyexpr.cpp tinyexpr.cpp
53+
ln -s src/tests tests
54+
4555
# Create compile_commands.json for clang-tidy
4656
- name: Configure CMake compile_commands.json
4757
run: |
48-
cmake -S tests -B "$BUILD_DIR" -DTE_BUILD_TEST_RUNNER=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja
58+
cmake -S . -B "$BUILD_DIR" -DTE_BUILD_TEST_RUNNER=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja
4959
# If your project generates headers, you can add a light build:
5060
# cmake --build "$BUILD_DIR" -j
5161

0 commit comments

Comments
 (0)