diff --git a/.github/appveyor.yml b/.github/appveyor.yml index e8012f69ee5b2e..42d25082076603 100644 --- a/.github/appveyor.yml +++ b/.github/appveyor.yml @@ -5,6 +5,7 @@ branches: - master - /\d\.\d/ - buildbot-custom + - appveyor-cygwin cache: - externals -> PCbuild before_build: @@ -28,11 +29,42 @@ before_build: build_script: - - cmd: PCbuild\build.bat -e -p x64 - - cmd: PCbuild\amd64\python.exe -m test.pythoninfo +- ps: | + if ($env:PLATFORM -eq "Win32") { + PCbuild\build.bat -e -p x64 + PCbuild\amd64\python.exe -m test.pythoninfo + } elseif ($env:PLATFORM -eq "Cygwin64") { + . .github\cygwin.ps1 + Cygwin cygcheck -s + Cygwin curl -s --output apt-cyg https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg + Cygwin chmod +x apt-cyg + Cygwin ./apt-cyg install libcrypt-devel libffi-devel zlib-devel "2>&1" + Cygwin ./configure + Cygwin make -j4 + Cygwin ./python.exe -m test.pythoninfo + } test_script: - - cmd: PCbuild\rt.bat -x64 -q -uall -u-cpu -u-largefile -rwW --slowest --timeout=1200 --fail-env-changed -j0 +- ps: | + if ($env:PLATFORM -eq "Win32") { + PCbuild\rt.bat -x64 -q -uall -u-cpu -u-largefile -rwW --slowest --timeout=1200 --fail-env-changed -j0 + if ($LastExitCode -eq 0) { + $host.SetShouldExit(0) + } + } elseif ($env:PLATFORM -eq "Cygwin64") { + . .github\cygwin.ps1 + # For now, skip tests that are failing locally + # Later we will want to expand this to more closely resemble hwo the + # tests are run for Linux on Travis-CI + Cygwin ./python.exe -E -Wd -m test -w --timeout=1200 --fail-env-changed -j0 -x test_argparse -x test_asyncio -x test_asyncore -x test_bufio -x test_c_locale_coercion -x test_concurrent_futures -x test_dbm_dumb -x test_distutils -x test_file -x test_file_eintr -x test_fileio -x test_grp -x test_httpservers -x test_import -x test_io -x test_ioctl -x test_largefile -x test_logging -x test_math -x test_memoryio -x test_mmap -x test_multiprocessing_fork -x test_multiprocessing_forkserver -x test_multiprocessing_main_handling -x test_multiprocessing_spawn -x test_os -x test_pathlib -x test_posix -x test_pwd -x test_py_compile -x test_resource -x test_selectors -x test_shutil -x test_signal -x test_socket -x test_socketserver -x test_ssl -x test_stat -x test_subprocess -x test_support -x test_tarfile -x test_tempfile -x test_univnewlines -x test_urllib -x test_utf8_mode -x test_venv -x test_zipfile + } environment: HOST_PYTHON: C:\Python36\python.exe image: - Visual Studio 2017 +platform: + - Win32 + - Cygwin64 +matrix: + fast_finish: true + allow_failures: + - platform: Cygwin64 diff --git a/.github/cygwin.ps1 b/.github/cygwin.ps1 new file mode 100644 index 00000000000000..aecae628e76f89 --- /dev/null +++ b/.github/cygwin.ps1 @@ -0,0 +1,10 @@ +function Cygwin { + $cygbin = "C:\\cygwin64\\bin" + $project_path = & "$cygbin\\cygpath" -u -a $env:APPVEYOR_BUILD_FOLDER + $cmd = ("C:\\cygwin64\\bin\\bash.exe -lc " +` + "'cd $project_path; $($args -join " ")'") + Invoke-Expression $cmd + if ($LastExitCode -ne 0) { + $host.SetShouldExit($LastExitCode) + } +}