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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user