mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 12:48:18 +00:00
[Ubuntu] Migrate tests for common tools to Pester (part 1) (#2288)
* add common tools tests pt1 * fix tests * fix erlang test * resolve comments * minor changes * remove extra logging
This commit is contained in:
committed by
GitHub
parent
7ff71c853d
commit
a9a236f7e5
@@ -10,5 +10,4 @@ source $HELPER_SCRIPTS/invoke-tests.sh
|
||||
apt-get update -y
|
||||
apt-get install -y p7zip p7zip-full p7zip-rar
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
invoke_tests "Tools" "7-Zip"
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/os.sh
|
||||
source $HELPER_SCRIPTS/invoke-tests.sh
|
||||
|
||||
# ppa:ansible/ansible doesn't contain packages for Ubuntu20.04
|
||||
if isUbuntu16 || isUbuntu18 ; then
|
||||
@@ -16,9 +17,4 @@ fi
|
||||
# Install latest Ansible
|
||||
apt-get install -y --no-install-recommends ansible
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
if ! command -v ansible; then
|
||||
echo "Ansible was not installed or found on PATH"
|
||||
exit 1
|
||||
fi
|
||||
invoke_tests "Tools" "Ansible"
|
||||
|
||||
@@ -18,5 +18,4 @@ tar zxvf /tmp/azcopy.tar.gz --strip-components=1 -C /tmp
|
||||
mv /tmp/azcopy /usr/local/bin/azcopy10
|
||||
chmod +x /usr/local/bin/azcopy10
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
invoke_tests "Tools" "azcopy"
|
||||
@@ -4,6 +4,8 @@
|
||||
## Desc: Installs Bazel and Bazelisk (A user-friendly launcher for Bazel)
|
||||
################################################################################
|
||||
|
||||
source $HELPER_SCRIPTS/invoke-tests.sh
|
||||
|
||||
# Install bazel
|
||||
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
|
||||
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
|
||||
@@ -13,14 +15,4 @@ apt-get install -y bazel
|
||||
# Install bazelisk
|
||||
npm install -g @bazel/bazelisk
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
if ! command -v bazel; then
|
||||
echo "Bazel was not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v bazelisk; then
|
||||
echo "Bazelisk was not installed"
|
||||
exit 1
|
||||
fi
|
||||
invoke_tests "Tools" "Bazel"
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/os.sh
|
||||
source $HELPER_SCRIPTS/invoke-tests.sh
|
||||
|
||||
function InstallClang {
|
||||
local version=$1
|
||||
@@ -16,16 +17,7 @@ function InstallClang {
|
||||
apt-get install -y "clang-format-$version"
|
||||
else
|
||||
apt-get install -y "clang-$version" "lldb-$version" "lld-$version" "clang-format-$version"
|
||||
fi
|
||||
|
||||
# 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 clang-$version clang++-$version; do
|
||||
if ! command -v $cmd; then
|
||||
echo "$cmd was not installed"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
function SetDefaultClang {
|
||||
@@ -41,15 +33,10 @@ function SetDefaultClang {
|
||||
wget https://apt.llvm.org/llvm.sh
|
||||
chmod +x llvm.sh
|
||||
|
||||
if isUbuntu16 || isUbuntu18; then
|
||||
versions=( "6.0" "8" "9" )
|
||||
default_clang_version="9"
|
||||
fi
|
||||
toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
|
||||
|
||||
if isUbuntu20 ; then
|
||||
versions=( "8" "9" "10" )
|
||||
default_clang_version="10"
|
||||
fi
|
||||
versions=$(jq -r '.clang.versions[]' $toolset)
|
||||
default_clang_version=$(jq -r '.clang.default_version' $toolset)
|
||||
|
||||
for version in ${versions[*]}; do
|
||||
InstallClang $version
|
||||
@@ -57,3 +44,5 @@ done
|
||||
|
||||
SetDefaultClang $default_clang_version
|
||||
rm llvm.sh
|
||||
|
||||
invoke_tests "Tools" "clang"
|
||||
@@ -4,6 +4,8 @@
|
||||
## Desc: Installs CMake
|
||||
################################################################################
|
||||
|
||||
source $HELPER_SCRIPTS/invoke-tests.sh
|
||||
|
||||
# Test to see if the software in question is already installed, if not install it
|
||||
echo "Checking to see if the installer script has already been run"
|
||||
if command -v cmake; then
|
||||
@@ -16,9 +18,4 @@ else
|
||||
&& rm cmakeinstall.sh
|
||||
fi
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
if ! command -v cmake; then
|
||||
echo "cmake was not installed"
|
||||
exit 1
|
||||
fi
|
||||
invoke_tests "Tools" "Cmake"
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
## Desc: Installs erlang
|
||||
################################################################################
|
||||
|
||||
source $HELPER_SCRIPTS/invoke-tests.sh
|
||||
|
||||
source_list=/etc/apt/sources.list.d/eslerlang.list
|
||||
|
||||
# Install Erlang
|
||||
@@ -17,14 +19,7 @@ wget -q -O rebar3 https://s3.amazonaws.com/rebar3/rebar3
|
||||
chmod +x rebar3
|
||||
mv rebar3 /usr/local/bin/rebar3
|
||||
|
||||
# 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 erl erlc rebar3; do
|
||||
if ! command -v $cmd; then
|
||||
echo "$cmd was not installed or not found on PATH"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
invoke_tests "Tools" "erlang"
|
||||
|
||||
# Clean up source list
|
||||
rm $source_list
|
||||
|
||||
@@ -6,35 +6,25 @@
|
||||
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/os.sh
|
||||
source $HELPER_SCRIPTS/invoke-tests.sh
|
||||
|
||||
function InstallGcc {
|
||||
version=$1
|
||||
|
||||
echo "Installing $version..."
|
||||
apt-get install $version -y
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
if ! command -v $version; then
|
||||
echo "$version was not installed"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Install GNU C++ compiler
|
||||
add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||
apt-get update -y
|
||||
|
||||
versions=(
|
||||
"g++-7"
|
||||
"g++-8"
|
||||
"g++-9"
|
||||
)
|
||||
toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
|
||||
|
||||
if ! isUbuntu16; then
|
||||
versions+=("g++-10")
|
||||
fi
|
||||
versions=$(jq -r '.gcc.versions[]' $toolset)
|
||||
|
||||
for version in ${versions[*]}; do
|
||||
InstallGcc $version
|
||||
done
|
||||
|
||||
invoke_tests "Tools" "gcc"
|
||||
@@ -3,36 +3,27 @@
|
||||
## File: gfortran.sh
|
||||
## Desc: Installs GNU Fortran
|
||||
################################################################################
|
||||
|
||||
source $HELPER_SCRIPTS/os.sh
|
||||
source $HELPER_SCRIPTS/invoke-tests.sh
|
||||
|
||||
function InstallFortran {
|
||||
version=$1
|
||||
|
||||
echo "Installing $version..."
|
||||
apt-get install $version -y
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
if ! command -v $version; then
|
||||
echo "$version was not installed"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Install GNU Fortran compiler
|
||||
add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||
apt-get update -y
|
||||
|
||||
versions=(
|
||||
"gfortran-8"
|
||||
"gfortran-9"
|
||||
)
|
||||
|
||||
if ! isUbuntu16; then
|
||||
versions+=("gfortran-10")
|
||||
fi
|
||||
toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
|
||||
versions=$(jq -r '.gfortran.versions[]' $toolset)
|
||||
|
||||
for version in ${versions[*]}
|
||||
do
|
||||
InstallFortran $version
|
||||
done
|
||||
|
||||
invoke_tests "Tools" "gfortran"
|
||||
Reference in New Issue
Block a user