Skip to content

Commit 4427621

Browse files
committed
Update datastructures-algorithms-ci-cd.yaml
1 parent 8129305 commit 4427621

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

.github/workflows/datastructures-algorithms-ci-cd.yaml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,39 @@ jobs:
2020
arch: x64
2121

2222
- name: Install dependencies
23+
shell: pwsh
2324
run: |
2425
choco install cmake -y
2526
choco install ninja -y
2627
choco install llvm -y
2728
2829
- name: Configure CMake
30+
shell: pwsh
2931
run: cmake -S . -B build -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
3032

3133
- name: Run clang-tidy
3234
shell: pwsh
3335
run: |
3436
clang-tidy --version
35-
$files = Get-ChildItem -Recurse -Path include, source -Include *.h,*.hpp,*.cpp,*.cc,*.cxx -File
36-
foreach ($file in $files) {
37-
Write-Host "Running clang-tidy on $($file.FullName)"
38-
$output = clang-tidy -p build "$($file.FullName)" --warnings-as-errors=* --checks=*-clang-diagnostic-pragma-once-outside-header 2>&1
39-
$filtered = $output | Where-Object { $_ -notmatch "Suppressed \d+ warnings" }
40-
$filtered | ForEach-Object { Write-Host $_ }
37+
$headerFiles = Get-ChildItem -Recurse -Path include, source -Include *.h,*.hpp -File
38+
$sourceFiles = Get-ChildItem -Recurse -Path include, source -Include *.cpp,*.cc,*.cxx -File
39+
40+
# Process header files with explicit header treatment
41+
foreach ($file in $headerFiles) {
42+
Write-Host "Running clang-tidy on header $($file.FullName)"
43+
clang-tidy -p build "$($file.FullName)" --warnings-as-errors=* --extra-arg=-xc++-header
44+
}
45+
46+
# Process source files normally
47+
foreach ($file in $sourceFiles) {
48+
Write-Host "Running clang-tidy on source $($file.FullName)"
49+
clang-tidy -p build "$($file.FullName)" --warnings-as-errors=*
4150
}
4251
4352
- name: Build
53+
shell: pwsh
4454
run: cmake --build build
4555

4656
- name: Run tests
57+
shell: pwsh
4758
run: ctest --test-dir build --output-on-failure

0 commit comments

Comments
 (0)