From 3d3f6975bbedbefe680f28636f6a425386c0dbd7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20De=20Keersmaeker?=
 <francois.dekeersmaeker@uclouvain.be>
Date: Sat, 19 Oct 2024 18:42:43 +0200
Subject: [PATCH] CI: fixed paths

---
 .ci_scripts/native-build/add_nft_rules.sh      | 3 +++
 .ci_scripts/native-build/run_cppcheck.sh       | 2 +-
 .ci_scripts/native-build/run_tests.sh          | 5 ++++-
 .ci_scripts/native-build/translate_profiles.sh | 3 +++
 4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/.ci_scripts/native-build/add_nft_rules.sh b/.ci_scripts/native-build/add_nft_rules.sh
index f3a8adf..4c5e617 100755
--- a/.ci_scripts/native-build/add_nft_rules.sh
+++ b/.ci_scripts/native-build/add_nft_rules.sh
@@ -1,5 +1,8 @@
 EXITCODE=0
 
+# Ensure globbing expands to an empty list if no matches are found
+shopt -s nullglob
+
 for nft_script in devices/*/firewall*.nft
 do
     # Try adding the ruleset
diff --git a/.ci_scripts/native-build/run_cppcheck.sh b/.ci_scripts/native-build/run_cppcheck.sh
index 256a579..faaae37 100755
--- a/.ci_scripts/native-build/run_cppcheck.sh
+++ b/.ci_scripts/native-build/run_cppcheck.sh
@@ -2,7 +2,7 @@ EXITCODE=0
 PARSERS_DIR="src/parsers"
 
 # Pattern matching on all source files
-for file in $(find "$GITHUB_WORKSPACE"/include "$GITHUB_WORKSPACE"/src "$GITHUB_WORKSPACE"/devices "$GITHUB_WORKSPACE"/test "$PARSERS_DIR"/include "$PARSERS_DIR"/src "$PARSERS_DIR"/test -name *.h -o -name *.c)
+for file in $(find include src devices test "$PARSERS_DIR"/include "$PARSERS_DIR"/src "$PARSERS_DIR"/test -name *.h -o -name *.c)
 do
     if [[ "$file" != *"/hashmap.c" ]]
     then
diff --git a/.ci_scripts/native-build/run_tests.sh b/.ci_scripts/native-build/run_tests.sh
index 9eab0f2..2a48fee 100755
--- a/.ci_scripts/native-build/run_tests.sh
+++ b/.ci_scripts/native-build/run_tests.sh
@@ -2,8 +2,11 @@ EXITCODE=0
 PARSERS_DIR="src/parsers"
 VALGRIND_SUPP=".ci_scripts/native-build/valgrind.supp"
 
+# Ensure globbing expands to an empty list if no matches are found
+shopt -s nullglob
+
 PREFIX=""
-for file in "$GITHUB_WORKSPACE"/bin/test/* "$PARSERS_DIR"/bin/test/*
+for file in bin/test/* "$PARSERS_DIR"/bin/test/*
 do
     if [[ "$file" == *"rule_utils-test" ]]
     then
diff --git a/.ci_scripts/native-build/translate_profiles.sh b/.ci_scripts/native-build/translate_profiles.sh
index 53721a4..8d99217 100755
--- a/.ci_scripts/native-build/translate_profiles.sh
+++ b/.ci_scripts/native-build/translate_profiles.sh
@@ -1,6 +1,9 @@
 # NFQueue start index
 NFQ_ID_START=0
 
+# Ensure globbing expands to an empty list if no matches are found
+shopt -s nullglob
+
 for DEVICE in devices/*
 do
     if [ -d $DEVICE ]
-- 
GitLab