Split the AppVeyor build into two jobs

master
David Allsopp 2018-09-06 18:55:00 +02:00
parent b069f692b4
commit 9c1f5f13d7
3 changed files with 68 additions and 66 deletions

View File

@ -28,6 +28,12 @@ environment:
CYG_CACHE: C:/cygwin64/var/cache/setup
FLEXDLL_VERSION: 0.37
OCAMLRUNPARAM: v=0,b
matrix:
- PORT: mingw32
- PORT: msvc64
matrix:
fast_finish: true
cache:
- C:\cygwin64\var\cache\setup

View File

@ -24,18 +24,6 @@ goto %1
goto :EOF
:SaveVars
set OCAML_PREV_PATH=%PATH%
set OCAML_PREV_LIB=%LIB%
set OCAML_PREV_INCLUDE=%INCLUDE%
goto :EOF
:RestoreVars
set PATH=%OCAML_PREV_PATH%
set LIB=%OCAML_PREV_LIB%
set INCLUDE=%OCAML_PREV_INCLUDE%
goto :EOF
:CheckPackage
"%CYG_ROOT%\bin\bash.exe" -lc "cygcheck -dc %1" | findstr %1 > nul
if %ERRORLEVEL% equ 1 (
@ -59,11 +47,15 @@ goto :EOF
chcp 65001 > nul
rem This must be kept in sync with appveyor_build.sh
set BUILD_PREFIX=🐫реализация
git worktree add "..\%BUILD_PREFIX%-msvc64" -b appveyor-build-msvc64
git worktree add "..\%BUILD_PREFIX%-mingw32" -b appveyor-build-mingw32
git worktree add "..\%BUILD_PREFIX%-msvc32" -b appveyor-build-msvc32
cd "..\%BUILD_PREFIX%-mingw32"
git submodule update --init flexdll
git worktree add "..\%BUILD_PREFIX%-%PORT%" -b appveyor-build-%PORT%
if "%PORT%" equ "msvc64" (
git worktree add "..\%BUILD_PREFIX%-msvc32" -b appveyor-build-%PORT%32
)
cd "..\%BUILD_PREFIX%-%PORT%"
if "%PORT%" equ "mingw32" (
git submodule update --init flexdll
)
cd "%APPVEYOR_BUILD_FOLDER%"
appveyor DownloadFile "https://github.com/alainfrisch/flexdll/archive/0.37.tar.gz" -FileName "flexdll.tar.gz" || exit /b 1
@ -80,8 +72,12 @@ rem in the list just so that the Cygwin version is always displayed on the log).
rem CYGWIN_COMMANDS is a corresponding command to run with --version to test
rem whether the package works. This is used to verify whether the installation
rem needs upgrading.
set CYGWIN_PACKAGES=cygwin make diffutils mingw64-i686-gcc-core
set CYGWIN_COMMANDS=cygcheck make diff i686-w64-mingw32-gcc
set CYGWIN_PACKAGES=cygwin make diffutils
set CYGWIN_COMMANDS=cygcheck make diff
if "%PORT%" equ "mingw32" (
set CYGWIN_PACKAGES=%CYGWIN_PACKAGES% mingw64-i686-gcc-core
set CYGWIN_COMMANDS=%CYGWIN_COMMANDS% i686-w64-mingw32-gcc
)
set CYGWIN_INSTALL_PACKAGES=
set CYGWIN_UPGRADE_REQUIRED=0
@ -91,23 +87,26 @@ call :UpgradeCygwin
"%CYG_ROOT%\bin\bash.exe" -lec "$APPVEYOR_BUILD_FOLDER/tools/ci/appveyor/appveyor_build.sh install" || exit /b 1
call :SaveVars
goto :EOF
:build
rem Run the msvc64 and mingw32 builds
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
if "%PORT%" equ "msvc64" (
setlocal
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
)
rem Do the main build (either msvc64 or mingw32)
"%CYG_ROOT%\bin\bash.exe" -lec "$APPVEYOR_BUILD_FOLDER/tools/ci/appveyor/appveyor_build.sh" || exit /b 1
if "%PORT%" neq "msvc64" goto :EOF
rem Reconfigure the environment and run the msvc32 partial build
call :RestoreVars
endlocal
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86
"%CYG_ROOT%\bin\bash.exe" -lec "$APPVEYOR_BUILD_FOLDER/tools/ci/appveyor/appveyor_build.sh msvc32-only" || exit /b 1
goto :EOF
:test
rem Reconfigure the environment for the msvc64 build
call :RestoreVars
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
"%CYG_ROOT%\bin\bash.exe" -lec "$APPVEYOR_BUILD_FOLDER/tools/ci/appveyor/appveyor_build.sh test" || exit /b 1
goto :EOF

View File

@ -65,8 +65,10 @@ case "$1" in
for f in flexdll.h flexlink.exe flexdll*_msvc.obj default*.manifest ; do
cp $f "$OCAMLROOT/bin/flexdll/"
done
echo 'eval $($APPVEYOR_BUILD_FOLDER/tools/msvs-promote-path)' \
>> ~/.bash_profile
if [ "$PORT" = "msvc64" ] ; then
echo 'eval $($APPVEYOR_BUILD_FOLDER/tools/msvs-promote-path)' \
>> ~/.bash_profile
fi
;;
msvc32-only)
cd $APPVEYOR_BUILD_FOLDER/../$BUILD_PREFIX-msvc32
@ -82,54 +84,49 @@ case "$1" in
;;
test)
FULL_BUILD_PREFIX=$APPVEYOR_BUILD_FOLDER/../$BUILD_PREFIX
run "ocamlc.opt -version" $FULL_BUILD_PREFIX-msvc64/ocamlc.opt -version
run "test msvc64" make -C $FULL_BUILD_PREFIX-msvc64 tests
run "test mingw32" make -C $FULL_BUILD_PREFIX-mingw32/testsuite \
USE_RUNTIME="d" all
run "install msvc64" make -C $FULL_BUILD_PREFIX-msvc64 install
run "install mingw32" make -C $FULL_BUILD_PREFIX-mingw32 install
run "check_all_arches" make -C $FULL_BUILD_PREFIX-msvc64 check_all_arches
run "ocamlc.opt -version" $FULL_BUILD_PREFIX-$PORT/ocamlc.opt -version
run "test $PORT" make -C $FULL_BUILD_PREFIX-$PORT tests
run "install $PORT" make -C $FULL_BUILD_PREFIX-$PORT install
if [ "$PORT" = "msvc64" ] ; then
run "check_all_arches" make -C $FULL_BUILD_PREFIX-$PORT check_all_arches
fi
;;
*)
cd $APPVEYOR_BUILD_FOLDER/../$BUILD_PREFIX-msvc64
cd $APPVEYOR_BUILD_FOLDER/../$BUILD_PREFIX-$PORT
tar -xzf $APPVEYOR_BUILD_FOLDER/flexdll.tar.gz
cd flexdll-$FLEXDLL_VERSION
make MSVC_DETECT=0 CHAINS=msvc64 support
cp flexdll*_msvc64.obj "$OCAMLROOT/bin/flexdll/"
cd ..
if [ "$PORT" = "msvc64" ] ; then
tar -xzf $APPVEYOR_BUILD_FOLDER/flexdll.tar.gz
cd flexdll-$FLEXDLL_VERSION
make MSVC_DETECT=0 CHAINS=msvc64 support
cp flexdll*_msvc64.obj "$OCAMLROOT/bin/flexdll/"
cd ..
fi
set_configuration msvc64 "$OCAMLROOT" -WX
if [ "$PORT" = "msvc64" ] ; then
set_configuration msvc64 "$OCAMLROOT" -WX
else
set_configuration mingw "$OCAMLROOT-mingw32" -Werror
fi
cd ../$BUILD_PREFIX-mingw32
set_configuration mingw "$OCAMLROOT-mingw32" -Werror
cd $APPVEYOR_BUILD_FOLDER/../$BUILD_PREFIX-msvc64
cd $APPVEYOR_BUILD_FOLDER/../$BUILD_PREFIX-$PORT
export TERM=ansi
script --quiet --return --command \
"make -C ../$BUILD_PREFIX-mingw32 flexdll world.opt" \
../$BUILD_PREFIX-mingw32/build.log >/dev/null 2>/dev/null &
BUILD_PID=$!
run "make world" make world
run "make bootstrap" make bootstrap
run "make opt" make opt
run "make opt.opt" make opt.opt
if [ "$PORT" = "mingw32" ] ; then
# For an explanation of the sed command, see
# https://github.com/appveyor/ci/issues/1824
script --quiet --return --command \
"make -C ../$BUILD_PREFIX-mingw32 flexdll world.opt" \
../$BUILD_PREFIX-mingw32/build.log |
sed -e 's/\d027\[K//g' \
-e 's/\d027\[m/\d027[0m/g' \
-e 's/\d027\[01\([m;]\)/\d027[1\1/g'
else
run "make world" make world
run "make bootstrap" make bootstrap
run "make opt" make opt
run "make opt.opt" make opt.opt
fi
set +e
# For an explanation of the sed command, see
# https://github.com/appveyor/ci/issues/1824
tail --pid=$BUILD_PID -n +1 -f ../$BUILD_PREFIX-mingw32/build.log | \
sed -e 's/\d027\[K//g' \
-e 's/\d027\[m/\d027[0m/g' \
-e 's/\d027\[01\([m;]\)/\d027[1\1/g' &
TAIL_PID=$!
wait $BUILD_PID
STATUS=$?
wait $TAIL_PID
exit $STATUS
;;
esac