check for apt-get before installing jq
parent
da456a3fa0
commit
3f24118d3e
|
@ -47,7 +47,7 @@ inputs:
|
|||
packageMode:
|
||||
required: false
|
||||
default: false
|
||||
description: 'Whether the tests are being run for a Unity package. Not needed for packages located within a Unity Project.'
|
||||
description: 'Whether the tests are being run for a Unity package instead of a Unity project. NOTE: If this is true, any custom docker image you pass must be compatible with apt-get.'
|
||||
outputs:
|
||||
artifactsPath:
|
||||
description: 'Path where the artifacts are stored'
|
||||
|
|
|
@ -10,13 +10,6 @@ LABEL "repository"="http://github.com/webbertakken/unity-actions"
|
|||
LABEL "homepage"="http://github.com/webbertakken/unity-actions"
|
||||
LABEL "maintainer"="Webber Takken <webber@takken.io>"
|
||||
|
||||
RUN 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/*
|
||||
|
||||
ADD steps /steps
|
||||
RUN chmod -R +x /steps
|
||||
ADD entrypoint.sh /entrypoint.sh
|
||||
|
|
|
@ -7,6 +7,27 @@
|
|||
ACTIVATE_LICENSE_PATH="$GITHUB_WORKSPACE/_activate-license"
|
||||
mkdir -p "$ACTIVATE_LICENSE_PATH"
|
||||
|
||||
#
|
||||
# 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
|
||||
echo "Running tests on a Unity package rather than a Unity project."
|
||||
echo "Checking if apt-get is installed."
|
||||
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
|
||||
|
||||
#
|
||||
# Run steps
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue