mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 05:30:13 +03:00
ci.sh: Refactor GDC special case
This commit is contained in:
parent
ddfb4fbcd7
commit
872c77e7a6
4 changed files with 21 additions and 21 deletions
|
@ -2,8 +2,6 @@ common_steps_template: &COMMON_STEPS_TEMPLATE
|
||||||
install_prerequisites_script: ./cirrusci.sh
|
install_prerequisites_script: ./cirrusci.sh
|
||||||
install_host_compiler_script: |
|
install_host_compiler_script: |
|
||||||
set -uexo pipefail
|
set -uexo pipefail
|
||||||
# kludge for ci.sh
|
|
||||||
if [ "${DMD:0:4}" == "gdmd" ]; then export DMD="gdmd"; fi
|
|
||||||
compiler="$DMD"
|
compiler="$DMD"
|
||||||
if [ -n "${D_VERSION+x}" ]; then compiler="$DMD-$D_VERSION"; fi
|
if [ -n "${D_VERSION+x}" ]; then compiler="$DMD-$D_VERSION"; fi
|
||||||
./ci.sh install_d "$compiler"
|
./ci.sh install_d "$compiler"
|
||||||
|
@ -46,7 +44,6 @@ task:
|
||||||
- TASK_NAME_SUFFIX: x64, LDC
|
- TASK_NAME_SUFFIX: x64, LDC
|
||||||
DMD: ldc
|
DMD: ldc
|
||||||
- TASK_NAME_SUFFIX: x64, GDC
|
- TASK_NAME_SUFFIX: x64, GDC
|
||||||
GDC_VERSION: 9
|
|
||||||
DMD: gdmd-9
|
DMD: gdmd-9
|
||||||
<< : *COMMON_STEPS_TEMPLATE
|
<< : *COMMON_STEPS_TEMPLATE
|
||||||
|
|
||||||
|
|
19
ci.sh
19
ci.sh
|
@ -172,23 +172,24 @@ download_install_sh() {
|
||||||
}
|
}
|
||||||
|
|
||||||
install_d() {
|
install_d() {
|
||||||
if [ "${DMD:-dmd}" == "gdc" ] || [ "${DMD:-dmd}" == "gdmd" ] ; then
|
local compiler="$1"
|
||||||
export DMD=gdmd-${GDC_VERSION}
|
if [ "${compiler:0:5}" == "gdmd-" ] ; then
|
||||||
if [ ! -e ~/dlang/gdc-${GDC_VERSION}/activate ] ; then
|
local gdc_version="${compiler:5}"
|
||||||
|
if [ ! -e ~/dlang/gdc-$gdc_version/activate ] ; then
|
||||||
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y gdc-${GDC_VERSION}
|
sudo apt-get install -y gdc-$gdc_version
|
||||||
# fetch the dmd-like wrapper
|
# fetch the dmd-like wrapper
|
||||||
sudo wget https://raw.githubusercontent.com/D-Programming-GDC/GDMD/master/dmd-script -O /usr/bin/gdmd-${GDC_VERSION}
|
sudo curl -fsSL -A "$CURL_USER_AGENT" --connect-timeout 5 --speed-time 30 --speed-limit 1024 --retry 5 --retry-delay 5 https://raw.githubusercontent.com/D-Programming-GDC/GDMD/master/dmd-script -o /usr/bin/gdmd-$gdc_version
|
||||||
sudo chmod +x /usr/bin/gdmd-${GDC_VERSION}
|
sudo chmod +x /usr/bin/gdmd-$gdc_version
|
||||||
# fake install script and create a fake 'activate' script
|
# fake install script and create a fake 'activate' script
|
||||||
mkdir -p ~/dlang/gdc-${GDC_VERSION}
|
mkdir -p ~/dlang/gdc-$gdc_version
|
||||||
echo "deactivate(){ echo;}" > ~/dlang/gdc-${GDC_VERSION}/activate
|
echo "deactivate(){ echo;}" > ~/dlang/gdc-$gdc_version/activate
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
local install_sh="install.sh"
|
local install_sh="install.sh"
|
||||||
download_install_sh "$install_sh"
|
download_install_sh "$install_sh"
|
||||||
CURL_USER_AGENT="$CURL_USER_AGENT" bash "$install_sh" "$1"
|
CURL_USER_AGENT="$CURL_USER_AGENT" bash "$install_sh" "$compiler"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ if [ "$OS_NAME" == "linux" ]; then
|
||||||
fi
|
fi
|
||||||
if [ "${DMD:0:4}" == "gdmd" ]; then
|
if [ "${DMD:0:4}" == "gdmd" ]; then
|
||||||
# ci.sh uses `sudo add-apt-repository ...` to add a PPA repo
|
# ci.sh uses `sudo add-apt-repository ...` to add a PPA repo
|
||||||
packages="$packages sudo software-properties-common wget"
|
packages="$packages sudo software-properties-common"
|
||||||
fi
|
fi
|
||||||
apt-get -q update
|
apt-get -q update
|
||||||
apt-get install -yq $packages
|
apt-get install -yq $packages
|
||||||
|
|
|
@ -30,17 +30,19 @@ else
|
||||||
fi
|
fi
|
||||||
export BRANCH
|
export BRANCH
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Install D host compiler
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
./ci.sh install_d "$DMD"
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Define commands
|
# Define commands
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
setup) ./ci.sh setup_repos ;;
|
setup)
|
||||||
testsuite) ./ci.sh testsuite ;;
|
./ci.sh setup_repos
|
||||||
|
;;
|
||||||
|
testsuite)
|
||||||
|
if [ "$DMD" == "gdc" ] || [ "$DMD" == "gdmd" ] ; then
|
||||||
|
export DMD=gdmd-$GDC_VERSION
|
||||||
|
fi
|
||||||
|
./ci.sh install_d "$DMD"
|
||||||
|
./ci.sh testsuite
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue