diff --git a/appveyor-clean-cache.txt b/appveyor-clean-cache.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/appveyor-clean-cache.txt @@ -0,0 +1 @@ +1 diff --git a/appveyor-run.cmd b/appveyor-run.cmd new file mode 100644 index 000000000..80229b38d --- /dev/null +++ b/appveyor-run.cmd @@ -0,0 +1,26 @@ +:: Execute etstool operation for every tookit in the argument list +:: Options +:: %1 -- operation +:: %2 -- runtime +:: %3... -- tookits +:: +:: +SETLOCAL EnableDelayedExpansion + +SET counter=0 + +FOR %%x IN (%*) DO ( +SET /A counter=!counter! + 1 +IF !counter! EQU 1 SET operation=%%x +IF !counter! EQU 2 SET runtime=%%x +IF !counter! GTR 2 CALL edm run -- python ci/edmtool.py !operation! --runtime=!runtime! --toolkit=%%x || GOTO error +) +GOTO end + +:error: +ENDLOCAL +EXIT /b %ERRORLEVEL% + +:end: +ENDLOCAL +ECHO.Done diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..08844bea8 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,35 @@ +build: false +shallow_clone: false +skip_branch_with_pr: true +environment: + + global: + PYTHONUNBUFFERED: "1" + INSTALL_EDM_VERSION: "1.11.0" + + matrix: + - RUNTIME: '2.7' + TOOLKITS: "null pyqt pyside wx" + - RUNTIME: '3.5' + TOOLKITS: "null pyqt" + - RUNTIME: '3.6' + TOOLKITS: "null pyqt" + +branches: + only: + - master + +cache: + - C:\Users\appveyor\.cache -> appveyor-clean-cache.txt + - C:\Users\appveyor\AppData\Local\pip\Cache -> appveyor-clean-cache.txt + +init: + - ps: $Env:path = "C:/Enthought/edm;" + $Env:path + - ps: md C:/Users/appveyor/.cache -Force + +install: + - install-edm-windows.cmd + - edm install -y wheel click coverage + - appveyor-run.cmd install %runtime% %toolkits% +test_script: + - appveyor-run.cmd test %runtime% %toolkits% diff --git a/install-edm-windows.cmd b/install-edm-windows.cmd new file mode 100644 index 000000000..01316d913 --- /dev/null +++ b/install-edm-windows.cmd @@ -0,0 +1,26 @@ +@ECHO OFF + +SETLOCAL EnableDelayedExpansion + +FOR /F "tokens=1,2,3 delims=." %%a in ("%INSTALL_EDM_VERSION%") do ( + SET MAJOR=%%a + SET MINOR=%%b + SET REVISION=%%c +) + +SET EDM_MAJOR_MINOR=%MAJOR%.%MINOR% +SET EDM_PACKAGE=edm_%INSTALL_EDM_VERSION%_x86_64.msi +SET EDM_INSTALLER_PATH=%HOMEDRIVE%%HOMEPATH%\.cache\%EDM_PACKAGE% +SET COMMAND="(new-object net.webclient).DownloadFile('https://package-data.enthought.com/edm/win_x86_64/%EDM_MAJOR_MINOR%/%EDM_PACKAGE%', '%EDM_INSTALLER_PATH%')" + +IF NOT EXIST %EDM_INSTALLER_PATH% CALL powershell.exe -Command %COMMAND% || GOTO error +CALL msiexec /qn /i %EDM_INSTALLER_PATH% EDMAPPDIR=C:\Enthought\edm || GOTO error + +ENDLOCAL +@ECHO.DONE +EXIT + +:error: +ENDLOCAL +@ECHO.ERROR +EXIT /b %ERRORLEVEL%