From 5f56fd6f4d4a6418fd9370406d9e97138ed77faf Mon Sep 17 00:00:00 2001 From: Ari Crellin-Quick Date: Wed, 5 Dec 2018 13:36:34 -0800 Subject: [PATCH] Set up CI with Azure Pipelines --- azure-pipelines.yml | 106 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..e10455d --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,106 @@ +# Python package +# Create and test a Python package on multiple Python versions. +# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/python + +jobs: + +- job: Windows + pool: + vmIMage: 'VS2017-Win2016' + variables: + # openblas URLs from numpy-wheels + # appveyor / Windows config + OPENBLAS_32: "https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com/openblas-v0.3.0-win32-gcc_7_1_0.zip" + OPENBLAS_64: "https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com/openblas-v0.3.0-win_amd64-gcc_7_1_0.zip" + strategy: + maxParallel: 6 + matrix: + Python36-32bit-fast: + PYTHON_VERSION: '3.6' + PYTHON_ARCH: 'x86' + TEST_MODE: fast + OPENBLAS: $(OPENBLAS_32) + BITS: 32 + Python37-32bit-fast: + PYTHON_VERSION: '3.7' + PYTHON_ARCH: 'x86' + TEST_MODE: fast + OPENBLAS: $(OPENBLAS_32) + BITS: 32 + Python27-64bit-fast: + PYTHON_VERSION: '2.7' + PYTHON_ARCH: 'x64' + TEST_MODE: fast + OPENBLAS: $(OPENBLAS_64) + BITS: 64 + Python35-64bit-full: + PYTHON_VERSION: '3.5' + PYTHON_ARCH: 'x64' + TEST_MODE: full + OPENBLAS: $(OPENBLAS_64) + BITS: 64 + Python36-64bit-full: + PYTHON_VERSION: '3.6' + PYTHON_ARCH: 'x64' + TEST_MODE: full + INSTALL_PICKLE5: 1 + OPENBLAS: $(OPENBLAS_64) + BITS: 64 + Python37-64bit-full: + PYTHON_VERSION: '3.7' + PYTHON_ARCH: 'x64' + TEST_MODE: full + INSTALL_PICKLE5: 1 + OPENBLAS: $(OPENBLAS_64) + BITS: 64 + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: $(PYTHON_VERSION) + addToPath: true + architecture: $(PYTHON_ARCH) + # as noted by numba project, currently need + # specific VC install for Python 2.7 + - powershell: | + $wc = New-Object net.webclient + $wc.Downloadfile("https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi", "VCForPython27.msi") + Start-Process "VCForPython27.msi" /qn -Wait + displayName: 'Install VC 9.0' + condition: eq(variables['PYTHON_VERSION'], '2.7') + - script: python -m pip install --upgrade pip setuptools wheel + displayName: 'Install tools' + - powershell: | + $wc = New-Object net.webclient + $wc.Downloadfile("$(OPENBLAS)", "openblas.zip") + $tmpdir = New-TemporaryFile | %{ rm $_; mkdir $_ } + Expand-Archive "openblas.zip" $tmpdir + $pyversion = python -c "from __future__ import print_function; import sys; print(sys.version.split()[0])" + Write-Host "Python Version: $pyversion" + $target = "C:\\hostedtoolcache\\windows\\Python\\$pyversion\\$(PYTHON_ARCH)\\lib\\openblas.a" + Write-Host "target path: $target" + cp $tmpdir\$(BITS)\lib\libopenblas_v0.3.0-gcc_7_1_0.a $target + displayName: 'Download / Install OpenBLAS' + - powershell: | + choco install -y mingw --forcex86 --force + displayName: 'Install 32-bit mingw for 32-bit builds' + condition: eq(variables['BITS'], 32) + - script: python -m pip install cython nose pytz pytest + displayName: 'Install dependencies; some are optional to avoid test skips' + # NOTE: for Windows builds it seems much more tractable to use runtests.py + # vs. manual setup.py and then runtests.py for testing only + - script: if [%INSTALL_PICKLE5%]==[1] python -m pip install pickle5 + displayName: 'Install optional pickle5 backport (only for python3.6 and 3.7)' + - powershell: | + If ($(BITS) -eq 32) { + $env:NPY_DISTUTILS_APPEND_FLAGS = 1 + $env:CFLAGS = "-m32" + $env:LDFLAGS = "-m32" + $env:PATH = "C:\\tools\\mingw32\\bin;" + $env:PATH + refreshenv + } + pip wheel -v -v -v --wheel-dir=dist . + ls dist -r | Foreach-Object { + pip install $_.FullName + } + displayName: 'Build cesium' \ No newline at end of file