diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..e4c5010cb --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,86 @@ +# AppVeyor configuration for EPICS Base + +# Ralph Lange +# Copyright (c) 2016-2017 ITER Organization + +# Version format +version: base-{branch}-{build} + +#---------------------------------# +# repository cloning # +#---------------------------------# + +# Called at very beginning, before repo cloning +init: + # Set autocrlf to make batch files work + - git config --global core.autocrlf true + +# Set clone depth (do not fetch complete history) +clone_depth: 2 + +# Skipping commits affecting only specific files +skip_commits: + files: + - 'documentation/*' + - 'templates/*' + - '**/*.html' + - '**/*.md' + +#---------------------------------# +# build matrix configuration # +#---------------------------------# + +# Build Configurations: dll/static, regular/debug +configuration: + - dynamic + - static + - dynamic-debug + - static-debug + +# Environment variables: compiler toolchain +environment: + matrix: + - TOOLCHAIN: 9.0 + - TOOLCHAIN: 10.0 + - TOOLCHAIN: 11.0 + - TOOLCHAIN: 12.0 + - TOOLCHAIN: 14.0 + - TOOLCHAIN: cygwin + - TOOLCHAIN: mingw + +# Platform: architecture +platform: + - x86 + - x64 + +# Matrix configuration: allow specific failing jobs +matrix: + exclude: + # VS Express installs don't have the 64 bit compiler + - platform: x64 + TOOLCHAIN: 9.0 + - platform: x64 + TOOLCHAIN: 10.0 + +#---------------------------------# +# building & testing # +#---------------------------------# + +install: + - cmd: ci/appveyor-prepare.bat + +build_script: + - cmd: ci/appveyor-make.bat + +test_script: + - cmd: ci/appveyor-make.bat runtests + +#---------------------------------# +# notifications # +#---------------------------------# + +notifications: + + - provider: Slack + incoming_webhook: + secure: RYOm3FIUYeZGjWKaeTVKwq+C3fzK54AKwbmAoECED45mex3lN+8HmrC845a6mg9xPUJ/ND51RopWVaKDD9/UzaM0SO195RQLKqUTIUafiuM= diff --git a/ci/appveyor-make.bat b/ci/appveyor-make.bat new file mode 100644 index 000000000..8ecf61dbe --- /dev/null +++ b/ci/appveyor-make.bat @@ -0,0 +1,118 @@ +:: Universal build script for AppVeyor (https://ci.appveyor.com/) +:: Environment: +:: TOOLCHAIN - toolchain version [9.0/10.0/11.0/12.0/14.0/cygwin/mingw] +:: CONFIGURATION - determines EPICS build [dynamic/static] +:: PLATFORM - architecture [x86/x64] +:: +:: All command line args are passed to make + +Setlocal EnableDelayedExpansion + +set "ST=" +if /i "%CONFIGURATION%"=="static" set ST=-static + +set OS=64BIT +if "%PLATFORM%"=="x86" set OS=32BIT + +echo [INFO] Platform: %OS% + +:: Use parallel make, except for 3.14 +set "MAKEARGS=-j2 -Otarget" +if "%APPVEYOR_REPO_BRANCH%"=="3.14" set MAKEARGS= + +if "%TOOLCHAIN%"=="cygwin" ( + set "MAKE=make" + if "%OS%"=="64BIT" ( + set "EPICS_HOST_ARCH=cygwin-x86_64" + set "INCLUDE=C:\cygwin64\include;%INCLUDE%" + set "PATH=C:\cygwin64\bin;%PATH%" + echo [INFO] Cygwin Toolchain 64bit + ) else ( + set "EPICS_HOST_ARCH=cygwin-x86" + set "INCLUDE=C:\cygwin\include;%INCLUDE%" + set "PATH=C:\cygwin\bin;%PATH%" + echo [INFO] Cygwin Toolchain 32bit + ) + echo [INFO] Compiler Version + gcc -v + goto Finish +) + +if "%TOOLCHAIN%"=="mingw" ( + set "MAKE=mingw32-make" + if "%OS%"=="64BIT" ( + set "EPICS_HOST_ARCH=windows-x64-mingw" + set "INCLUDE=C:\tools\mingw64\include;%INCLUDE%" + set "PATH=C:\tools\mingw64\bin;%PATH%" + echo [INFO] MinGW Toolchain 64bit + ) else ( + set "EPICS_HOST_ARCH=win32-x86-mingw" + set "INCLUDE=C:\tools\mingw32\include;%INCLUDE%" + set "PATH=C:\tools\mingw32\bin;%PATH%" + echo [INFO] MinGW Toolchain 32bit + ) + echo [INFO] Compiler Version + gcc -v + goto Finish +) + +set "VSINSTALL=C:\Program Files (x86)\Microsoft Visual Studio %TOOLCHAIN%" +set "MAKE=C:\tools\make" + +if "%OS%"=="64BIT" ( + set EPICS_HOST_ARCH=windows-x64%ST% + if exist "%VSINSTALL%\VC\vcvarsall.bat" ( + call "%VSINSTALL%\VC\vcvarsall.bat" amd64 + where cl + if !ERRORLEVEL! NEQ 0 ( + call "%VSINSTALL%\VC\vcvarsall.bat" x86_amd64 + where cl + if !ERRORLEVEL! NEQ 0 goto MSMissing + ) + goto MSFound + ) + if exist "%VSINSTALL%\VC\bin\amd64\vcvars64.bat" ( + call "%VSINSTALL%\VC\bin\amd64\vcvars64.bat" + where cl + if !ERRORLEVEL! NEQ 0 goto MSMissing + goto MSFound + ) +) else ( + set EPICS_HOST_ARCH=win32-x86%ST% + if exist "%VSINSTALL%\VC\vcvarsall.bat" ( + call "%VSINSTALL%\VC\vcvarsall.bat" x86 + where cl + if !ERRORLEVEL! NEQ 0 goto MSMissing + goto MSFound + ) + if exist "%VSINSTALL%\VC\bin\vcvars32.bat" ( + call "%VSINSTALL%\VC\bin\vcvars32.bat" + where cl + if !ERRORLEVEL! NEQ 0 goto MSMissing + goto MSFound + ) + if exist "%VSINSTALL%\Common7\Tools\vsvars32.bat" ( + call "%VSINSTALL%\Common7\Tools\vsvars32.bat" + where cl + if !ERRORLEVEL! NEQ 0 goto MSMissing + goto MSFound + ) +) + +:MSMissing +echo [INFO] Installation for MSVC Toolchain %TOOLCHAIN% / %OS% seems to be missing +exit 1 + +:MSFound +echo [INFO] Microsoft Visual Studio Toolchain %TOOLCHAIN% +echo [INFO] Compiler Version +cl + +:Finish +echo [INFO] EPICS_HOST_ARCH: %EPICS_HOST_ARCH% +echo [INFO] Make version +%MAKE% --version +echo [INFO] Perl version +perl --version + +%MAKE% %MAKEARGS% %* diff --git a/ci/appveyor-prepare.bat b/ci/appveyor-prepare.bat new file mode 100644 index 000000000..6edb7b52f --- /dev/null +++ b/ci/appveyor-prepare.bat @@ -0,0 +1,70 @@ +:: Build script for AppVeyor (https://ci.appveyor.com/) +:: Environment: +:: TOOLCHAIN - Toolchain Version [9.0/10.0/11.0/12.0/14.0/cygwin/mingw] +:: CONFIGURATION - determines EPICS build [dynamic/static, -debug] +:: PLATFORM - "x86" -> use 32bit architecture +:: +:: Prepares an Appveyor build by excuting the following steps +:: - Set up configure\CONFIG_SITE for static vs. dynamic build +:: - Install Cygwin / Mingw (TOOLCHAIN setting) in the in the appropriate flavor +:: - Download and install Make-4.1 from EPICS download page + +Setlocal EnableDelayedExpansion + +set OS=64BIT +if "%PLATFORM%"=="x86" set OS=32BIT + +echo [INFO] Platform: %OS% + +if "%TOOLCHAIN%"=="cygwin" ( + echo.%CONFIGURATION% | findstr /C:"static">nul && ( + echo SHARED_LIBRARIES=NO>> configure\CONFIG_SITE + echo STATIC_BUILD=YES>> configure\CONFIG_SITE + echo [INFO] EPICS set up for static build + ) || ( + echo [INFO] EPICS set up for dynamic build + ) + echo.%CONFIGURATION% | findstr /C:"debug">nul && ( + echo HOST_OPT=NO>> configure\CONFIG_SITE + echo [INFO] EPICS set up for debug build + ) || ( + echo [INFO] EPICS set up for optimized build + ) + if "%OS%"=="64BIT" ( + echo [INFO] Installing Cygwin 64bit and dependencies + @powershell -Command "(new-object net.webclient).DownloadFile('http://www.cygwin.com/setup-x86_64.exe', 'C:\cygwin64\setup-x86_64.exe')" + C:\cygwin64\setup-x86_64.exe -q -P "libreadline-devel,libncursesw-devel" + ) else ( + echo [INFO] Installing Cygwin 32bit and dependencies + @powershell -Command "(new-object net.webclient).DownloadFile('http://www.cygwin.com/setup-x86.exe', 'C:\cygwin\setup-x86.exe')" + C:\cygwin\setup-x86.exe -q -P "libreadline-devel,libncursesw-devel" + ) +) + +if "%TOOLCHAIN%"=="mingw" ( + echo.%CONFIGURATION% | findstr /C:"static">nul && ( + echo SHARED_LIBRARIES=NO>> configure\CONFIG_SITE + echo STATIC_BUILD=YES>> configure\CONFIG_SITE + echo [INFO] EPICS set up for static build + ) || ( + echo [INFO] EPICS set up for dynamic build + ) + echo.%CONFIGURATION% | findstr /C:"debug">nul && ( + echo HOST_OPT=NO>> configure\CONFIG_SITE + echo [INFO] EPICS set up for debug build + ) || ( + echo [INFO] EPICS set up for optimized build + ) + if "%OS%"=="64BIT" ( + echo [INFO] Installing MinGW 64bit + cinst mingw || cinst mingw + ) else ( + echo [INFO] Installing MinGW 32bit + cinst mingw --x86 || cinst mingw --x86 + ) +) + +echo [INFO] Installing Make 4.1 +@powershell -Command "(new-object net.webclient).DownloadFile('https://www.aps.anl.gov/epics/download/tools/make-4.1-win64.zip', 'C:\tools\make-4.1.zip')" +cd \tools +"C:\Program Files\7-Zip\7z" e make-4.1.zip