fix: use find instead of ls for clang detection in CI
CI / build-and-test (push) Failing after 33s

ls returns exit code 2 when glob has no matches, which fails the
build step under set -e + pipefail. find returns 0 even when no
files are found.
This commit is contained in:
2026-08-04 14:22:46 -04:00
parent 5668708fed
commit 4a8b87e2cd
+2 -1
View File
@@ -38,9 +38,10 @@ jobs:
- name: Build kappa
run: |
CC=$(ls /usr/bin/clang-1[5-9] /usr/bin/clang-2[0-9] 2>/dev/null | head -1)
CC=$(find /usr/bin -maxdepth 1 \( -name 'clang-1[5-9]' -o -name 'clang-2[0-9]' \) 2>/dev/null | head -1)
if [ -z "$CC" ]; then CC=/usr/bin/clang-18; fi
CXX="${CC}++"
echo "Using compiler: $CXX"
cmake -B build -G Ninja \
-DCMAKE_C_COMPILER="$CC" \
-DCMAKE_CXX_COMPILER="$CXX"