Skip to content

Commit

Permalink
ci: fixed script running tests to match requirements of test_flb_util…
Browse files Browse the repository at this point in the history
…s_get_machine_id test for flb_utils_get_machine_id function from flb_utils.c

Signed-off-by: Marat Abrarov <[email protected]>
  • Loading branch information
mabrarov committed Nov 21, 2024
1 parent 8994bfc commit 59d45e2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion run_code_analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,20 @@ elif [[ ! -f "$SOURCE_DIR"/CMakeLists.txt ]]; then
exit 1
fi

machine_id_file="$(mktemp)"
< /dev/urandom tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 > "${machine_id_file}"

exit_code=0
# Run the action we want on it but using an in-container build directory to prevent various permissions errors and files locally
"$CONTAINER_RUNTIME" run --rm -t -w "/tmp/source" -v "${SOURCE_DIR}:/source:ro" \
-v "${machine_id_file}:/etc/machine-id:ro" \
-e INPUT_PRESET="$TEST_PRESET" \
-e INPUT_DEPENDENCIES_DEBIAN="$ADDITIONAL_DEPS" \
-e INPUT_CMAKEFLAGS="$FLB_CMAKE_OPTIONS $SKIP" \
-e INPUT_PRE_COMMAND="cp -R /source /tmp" \
-e INPUT_WORKING-DIRECTORY="/tmp/source" \
lpenz/ghaction-cmake:0.19
lpenz/ghaction-cmake:0.19 \
|| exit_code=$?

rm -f "${machine_id_file}"
exit "${exit_code}"

0 comments on commit 59d45e2

Please sign in to comment.