Use quick install script to test R builds

This commit is contained in:
Greg Lin 2022-08-10 18:53:42 -05:00
commit 83dfc554f2
9 changed files with 103 additions and 125 deletions

View file

@ -3,73 +3,65 @@ version: '2.0'
services:
ubuntu-1804:
image: ubuntu:bionic
command: /test/test-deb.sh
command: /r-builds/test/test-apt.sh
environment:
- OS_IDENTIFIER=ubuntu-1804
- R_VERSION=${R_VERSION}
volumes:
- ./:/test
- ../builder/integration/tmp:/packages
- ../:/r-builds
ubuntu-2004:
image: ubuntu:focal
command: /test/test-deb.sh
command: /r-builds/test/test-apt.sh
environment:
- OS_IDENTIFIER=ubuntu-2004
- R_VERSION=${R_VERSION}
volumes:
- ./:/test
- ../builder/integration/tmp:/packages
- ../:/r-builds
ubuntu-2204:
image: ubuntu:jammy
command: /test/test-deb.sh
command: /r-builds/test/test-apt.sh
environment:
- OS_IDENTIFIER=ubuntu-2204
- R_VERSION=${R_VERSION}
volumes:
- ./:/test
- ../builder/integration/tmp:/packages
- ../:/r-builds
debian-11:
image: debian:bullseye
command: /test/test-deb.sh
command: /r-builds/test/test-apt.sh
environment:
- OS_IDENTIFIER=debian-11
- R_VERSION=${R_VERSION}
volumes:
- ./:/test
- ../builder/integration/tmp:/packages
- ../:/r-builds
debian-10:
image: debian:buster
command: /test/test-deb.sh
command: /r-builds/test/test-apt.sh
environment:
- OS_IDENTIFIER=debian-10
- R_VERSION=${R_VERSION}
volumes:
- ./:/test
- ../builder/integration/tmp:/packages
- ../:/r-builds
centos-7:
image: centos:centos7
command: /test/test-centos.sh
command: /r-builds/test/test-yum.sh
environment:
- OS_IDENTIFIER=centos-7
- R_VERSION=${R_VERSION}
volumes:
- ./:/test
- ../builder/integration/tmp:/packages
- ../:/r-builds
centos-8:
image: rockylinux:8
command: /test/test-centos.sh
command: /r-builds/test/test-yum.sh
environment:
- OS_IDENTIFIER=centos-8
- R_VERSION=${R_VERSION}
volumes:
- ./:/test
- ../builder/integration/tmp:/packages
- ../:/r-builds
opensuse-153:
image: opensuse/leap:15.3
command: /test/test-opensuse.sh
command: /r-builds/test/test-zypper.sh
environment:
- OS_IDENTIFIER=opensuse-153
- R_VERSION=${R_VERSION}
volumes:
- ./:/test
- ../builder/integration/tmp:/packages
- ../:/r-builds

27
test/test-apt.sh Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -ex
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
# Install quick install script prerequisites
if ! command -v curl > /dev/null 2>&1; then
apt update -qq
apt install -y curl
fi
# Run the quick install script. Use a locally built file if present, otherwise from the CDN.
tmpdir=$(mktemp -d)
cp -r "${SCRIPT_DIR}/../builder/integration/tmp/${OS_IDENTIFIER}/." "$tmpdir" > /dev/null 2>&1 || true
(cd "$tmpdir" && SCRIPT_ACTION=install R_VERSION="${R_VERSION}" RUN_UNATTENDED=1 "${SCRIPT_DIR}/../install.sh")
# Show DEB info
apt show "r-${R_VERSION}"
"${SCRIPT_DIR}/test-r.sh"
apt remove -y "r-${R_VERSION}"
if [ -d "/opt/R/${R_VERSION}" ]; then
echo "Failed to uninstall completely"
exit 1
fi

View file

@ -1,25 +0,0 @@
#!/usr/bin/env bash
set -ex
PKG_FILE=/packages/${OS_IDENTIFIER}/R-${R_VERSION}-1-1.x86_64.rpm
if [ ! -f ${PKG_FILE} ]; then
echo "No package found, skipping tests"
exit 0
fi
yum -y -q update
yum -y install epel-release
yum -y install ${PKG_FILE}
# Show rpm info
rpm -qi R-${R_VERSION}
/test/test-r.sh
yum -y remove R-${R_VERSION}
if [ -d /opt/R/${R_VERSION} ]; then
echo "Failed to uninstall completely"
exit 1
fi

View file

@ -1,25 +0,0 @@
#!/usr/bin/env bash
set -ex
PKG_FILE=/packages/${OS_IDENTIFIER}/r-${R_VERSION}_1_amd64.deb
if [ ! -f ${PKG_FILE} ]; then
echo "No package found, skipping tests"
exit 0
fi
export DEBIAN_FRONTEND=noninteractive
apt-get update -qq
apt-get install -f -y ${PKG_FILE}
# Show deb info
apt-cache show r-${R_VERSION}
/test/test-r.sh
apt-get remove -y r-${R_VERSION}
if [ -d /opt/R/${R_VERSION} ]; then
echo "Failed to uninstall completely"
exit 1
fi

View file

@ -1,23 +0,0 @@
#!/usr/bin/env bash
set -ex
PKG_FILE=/packages/${OS_IDENTIFIER}/R-${R_VERSION}-1-1.x86_64.rpm
if [ ! -f ${PKG_FILE} ]; then
echo "No package found, skipping tests"
exit 0
fi
zypper --non-interactive --no-gpg-checks install ${PKG_FILE}
# Show rpm info
rpm -qi R-${R_VERSION}
/test/test-r.sh
zypper --non-interactive remove R-${R_VERSION}
if [ -d /opt/R/${R_VERSION} ]; then
echo "Failed to uninstall completely"
exit 1
fi

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -ex
DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
R_HOME=/opt/R/${R_VERSION}/lib/R
"${R_HOME}/bin/R" --version
@ -15,4 +15,4 @@ gfortran --version
# List shared library dependencies (e.g. BLAS/LAPACK)
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${R_HOME}/lib ldd "${R_HOME}/lib/libR.so"
DIR=${DIR} "${R_HOME}/bin/Rscript" /test/test.R
DIR=$SCRIPT_DIR "${R_HOME}/bin/Rscript" "${SCRIPT_DIR}/test.R"

View file

@ -1,26 +0,0 @@
#!/usr/bin/env bash
set -ex
PKG_FILE=/packages/${OS_IDENTIFIER}/R-${R_VERSION}-1-1.x86_64.rpm
if [ ! -f ${PKG_FILE} ]; then
echo "No package found, skipping tests"
exit 0
fi
dnf -y install dnf-plugins-core
dnf config-manager --set-enabled crb
dnf -y install epel-release
dnf -y install ${PKG_FILE}
# Show rpm info
rpm -qi R-${R_VERSION}
/test/test-r.sh
dnf -y remove R-${R_VERSION}
if [ -d /opt/R/${R_VERSION} ]; then
echo "Failed to uninstall completely"
exit 1
fi

32
test/test-yum.sh Executable file
View file

@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -ex
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
if command -v dnf > /dev/null 2>&1; then
YUM=dnf
else
YUM=yum
fi
# Install quick install script prerequisites
if ! command -v curl > /dev/null 2>&1; then
$YUM install -y curl
fi
# Run the quick install script. Use a locally built file if present, otherwise from the CDN.
tmpdir=$(mktemp -d)
cp -r "${SCRIPT_DIR}/../builder/integration/tmp/${OS_IDENTIFIER}/." "$tmpdir" > /dev/null 2>&1 || true
(cd "$tmpdir" && SCRIPT_ACTION=install R_VERSION="${R_VERSION}" RUN_UNATTENDED=1 "${SCRIPT_DIR}/../install.sh")
# Show rpm info
rpm -qi "R-${R_VERSION}"
"${SCRIPT_DIR}/test-r.sh"
$YUM -y remove "R-${R_VERSION}"
if [ -d "/opt/R/${R_VERSION}" ]; then
echo "Failed to uninstall completely"
exit 1
fi

26
test/test-zypper.sh Executable file
View file

@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -ex
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
# Install quick install script prerequisites
if ! command -v curl > /dev/null 2>&1; then
zypper --non-interactive install curl
fi
# Run the quick install script. Use a locally built file if present, otherwise from the CDN.
tmpdir=$(mktemp -d)
cp -r "${SCRIPT_DIR}/../builder/integration/tmp/${OS_IDENTIFIER}/." "$tmpdir" > /dev/null 2>&1 || true
(cd "$tmpdir" && SCRIPT_ACTION=install R_VERSION="${R_VERSION}" RUN_UNATTENDED=1 "${SCRIPT_DIR}/../install.sh")
# Show RPM info
rpm -qi "R-${R_VERSION}"
"${SCRIPT_DIR}/test-r.sh"
zypper --non-interactive remove "R-${R_VERSION}"
if [ -d "/opt/R/${R_VERSION}" ]; then
echo "Failed to uninstall completely"
exit 1
fi