mirror of
https://github.com/actions/runner-images.git
synced 2025-12-10 19:16:48 +00:00
Databases and java pester tests (#2338)
* added mongodb postgres java tests * fixed 1.7 and 12 Java on Ubuntu 20 * several improvments * removed update-environment function * add etc-environment import * removed sourcing invoke-tests Co-authored-by: Leonid Lapshin <originalnoe-nazvanie@yandex.ru>
This commit is contained in:
@@ -5,15 +5,7 @@
|
||||
################################################################################
|
||||
|
||||
source $HELPER_SCRIPTS/os.sh
|
||||
|
||||
function javaTool {
|
||||
if [[ "$2" =~ ([1]{0,1}.)?$DEFAULT_JDK_VERSION.* ]]; then
|
||||
echo "$1 $2 is equal to default one $DEFAULT_JDK_VERSION"
|
||||
else
|
||||
echo "$1 $2 is not equal to default one $DEFAULT_JDK_VERSION"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
source $HELPER_SCRIPTS/etc-environment.sh
|
||||
|
||||
# Install GPG Key for Adopt Open JDK. See https://adoptopenjdk.net/installation.html
|
||||
wget -qO - "https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public" | apt-key add -
|
||||
@@ -86,16 +78,5 @@ rm gradleLatest.zip
|
||||
ln -s /usr/share/gradle-"${gradleVersion}"/bin/gradle /usr/bin/gradle
|
||||
echo "GRADLE_HOME=/usr/share/gradle" | tee -a /etc/environment
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
for cmd in gradle java javac mvn ant; do
|
||||
if ! command -v $cmd; then
|
||||
echo "$cmd was not installed or found on path"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
javaVersion=$(java -version |& head -n 1 | cut -d\" -f 2)
|
||||
javaTool "Java" $javaVersion
|
||||
javacVersion=$(javac -version |& cut -d" " -f2)
|
||||
javaTool "Javac" $javacVersion
|
||||
reloadEtcEnvironment
|
||||
invoke_tests "Java"
|
||||
|
||||
Reference in New Issue
Block a user