unity-test-runner/dist/entrypoint.sh

69 lines
1.5 KiB
Bash
Raw Normal View History

2019-11-30 15:36:27 +00:00
#!/usr/bin/env bash
#
# Create directory for license activation
#
ACTIVATE_LICENSE_PATH="$GITHUB_WORKSPACE/_activate-license"
mkdir -p "$ACTIVATE_LICENSE_PATH"
2022-01-17 18:30:18 +00:00
#
# Check if apt-get is available if in package mode (if not, we must abort since we need to install jq)
#
if [ "$PACKAGE_MODE" = "true" ]; then
2022-01-17 18:58:59 +00:00
echo "Checking if apt-get is installed to install jq."
2022-01-17 18:30:18 +00:00
apt-get --version > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "apt-get is not installed. Aborting..."
exit
fi
# install jq
apt-get update \
&& apt-get upgrade -y --force-yes \
&& apt-get install -y --force-yes \
jq \
&& apt-get clean \
&& rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
fi
2019-11-30 15:36:27 +00:00
#
# Run steps
2019-11-30 15:36:27 +00:00
#
source /steps/activate.sh
source /steps/set_gitcredential.sh
source /steps/run_tests.sh
source /steps/return_license.sh
2019-11-30 15:36:27 +00:00
#
# Remove license activation directory
#
rm -r "$ACTIVATE_LICENSE_PATH"
2020-09-27 19:19:29 +00:00
#
# Instructions for debugging
#
if [[ $TEST_RUNNER_EXIT_CODE -gt 0 ]]; then
echo ""
echo "###########################"
echo "# Failure #"
echo "###########################"
echo ""
echo "Please note that the exit code is not very descriptive."
echo "Most likely it will not help you solve the issue."
echo ""
echo "To find the reason for failure: please search for errors in the log above."
echo ""
fi;
2019-11-30 15:36:27 +00:00
#
# Exit with code from the build step.
2019-11-30 15:36:27 +00:00
#
if [[ $USE_EXIT_CODE == true || $TEST_RUNNER_EXIT_CODE -ne 2 ]]; then
exit $TEST_RUNNER_EXIT_CODE
2021-02-27 18:13:19 +00:00
fi;