Skip to content

Set up CI with Azure Pipelines #22760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Sep 19, 2018
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ matrix:
exclude:
# Exclude the default Python 3.5 build
- python: 3.5
include:
- os: osx
language: generic
env:
- JOB="3.5, OSX" ENV_FILE="ci/travis-35-osx.yaml" TEST_ARGS="--skip-slow --skip-network"

- dist: trusty
env:
Expand Down
91 changes: 0 additions & 91 deletions appveyor.yml

This file was deleted.

25 changes: 25 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Adapted from https://github.com/numba/numba/blob/master/azure-pipelines.yml
jobs:
# Mac and Linux could potentially use the same template
# except it isn't clear how to use a different build matrix
# for each, so for now they are separate
- template: ci/azure/macos.yml
parameters:
name: macOS
vmImage: xcode9-macos10.13
# - template: ci/azure/linux.yml
# parameters:
# name: Linux
# vmImage: ubuntu-16.04

# Windows Python 2.7 needs VC 9.0 installed, and not sure
# how to make that a conditional task, so for now these are
# separate templates as well
- template: ci/azure/windows.yml
parameters:
name: Windows
vmImage: vs2017-win2017
- template: ci/azure/windows-py27.yml
parameters:
name: WindowsPy27
vmImage: vs2017-win2017
File renamed without changes.
File renamed without changes.
File renamed without changes.
39 changes: 39 additions & 0 deletions ci/azure/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
parameters:
name: ''
vmImage: ''

jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
maxParallel: 11
matrix:
py35_np_110:
ENV_FILE: ci/azure-macos-35.yml
CONDA_PY: "35"
CONDA_ENV: pandas
TEST_ARGS: "--skip-slow --skip-network"

steps:
- script: |
if [ "$(uname)" == "Linux" ]; then sudo apt-get install -y libc6-dev-i386; fi
echo "Installing Miniconda"
ci/incremental/install_miniconda.sh
export PATH=$HOME/miniconda3/bin:$PATH
echo "Setting up Conda environment"
ci/incremental/setup_conda_environment.sh
displayName: 'Before Install'
- script: |
export PATH=$HOME/miniconda3/bin:$PATH
ci/incremental/build.sh
displayName: 'Build'
- script: |
export PATH=$HOME/miniconda3/bin:$PATH
ci/script_single.sh
ci/script_multi.sh
echo "[Test done]"
displayName: 'Test'
- script: |
export PATH=$HOME/miniconda3/bin:$PATH
source activate pandas && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd
41 changes: 41 additions & 0 deletions ci/azure/windows-py27.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
parameters:
name: ''
vmImage: ''

jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
maxParallel: 11
matrix:
py36_np14:
ENV_FILE: ci/azure-windows-27.yml
CONDA_PY: "27"
CONDA_ENV: pandas

steps:
- task: CondaEnvironment@1
inputs:
updateConda: no
packageSpecs: ''

# Need to install VC 9.0 only for Python 2.7
# Once we understand how to do tasks conditional on build matrix variables
# we could merge this into azure-windows.yml
- 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'

- script: |
ci\\incremental\\setup_conda_environment.cmd
displayName: 'Before Install'
- script: |
ci\\incremental\\build.cmd
displayName: 'Build'
- script: |
call activate %CONDA_ENV%
pytest --skip-slow --skip-network pandas -n 2 -r sxX --strict %*
displayName: 'Test'
32 changes: 32 additions & 0 deletions ci/azure/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
parameters:
name: ''
vmImage: ''

jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
maxParallel: 11
matrix:
py36_np14:
ENV_FILE: ci/azure-windows-36.yml
CONDA_PY: "36"
CONDA_ENV: pandas

steps:
- task: CondaEnvironment@1
inputs:
updateConda: no
packageSpecs: ''

- script: |
ci\\incremental\\setup_conda_environment.cmd
displayName: 'Before Install'
- script: |
ci\\incremental\\build.cmd
displayName: 'Build'
- script: |
call activate %CONDA_ENV%
pytest --skip-slow --skip-network pandas -n 2 -r sxX --strict %*
displayName: 'Test'
10 changes: 10 additions & 0 deletions ci/incremental/build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@rem https://github.com/numba/numba/blob/master/buildscripts/incremental/build.cmd
call activate %CONDA_ENV%

@rem Build numba extensions without silencing compile errors
python setup.py build_ext -q --inplace

@rem Install pandas locally
python -m pip install -e .

if %errorlevel% neq 0 exit /b %errorlevel%
18 changes: 18 additions & 0 deletions ci/incremental/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

source activate $CONDA_ENV

# Make sure any error below is reported as such
set -v -e

echo "[building extensions]"
python setup.py build_ext -q --inplace
python -m pip install -e .

echo
echo "[show environment]"
conda list

echo
echo "[done]"
exit 0
19 changes: 19 additions & 0 deletions ci/incremental/install_miniconda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -v -e

# Install Miniconda
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
if [[ "$BITS32" == "yes" ]]; then
wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86.sh -O miniconda.sh
else
wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
fi
elif [[ "$unamestr" == 'Darwin' ]]; then
wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
else
echo Error
fi
chmod +x miniconda.sh
./miniconda.sh -b
21 changes: 21 additions & 0 deletions ci/incremental/setup_conda_environment.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@rem https://github.com/numba/numba/blob/master/buildscripts/incremental/setup_conda_environment.cmd
@rem The cmd /C hack circumvents a regression where conda installs a conda.bat
@rem script in non-root environments.
set CONDA_INSTALL=cmd /C conda install -q -y
set PIP_INSTALL=pip install -q

@echo on

@rem Deactivate any environment
call deactivate
@rem Display root environment (for debugging)
conda list
@rem Clean up any left-over from a previous build
conda remove --all -q -y -n %CONDA_ENV%
@rem Scipy, CFFI, jinja2 and IPython are optional dependencies, but exercised in the test suite
conda env create -n %CONDA_ENV% --file=ci\azure-windows-%CONDA_PY%.yaml

call activate %CONDA_ENV%
conda list

if %errorlevel% neq 0 exit /b %errorlevel%
48 changes: 48 additions & 0 deletions ci/incremental/setup_conda_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

set -v -e

CONDA_INSTALL="conda install -q -y"
PIP_INSTALL="pip install -q"

# Deactivate any environment
source deactivate
# Display root environment (for debugging)
conda list
# Clean up any left-over from a previous build
# (note workaround for https://github.com/conda/conda/issues/2679:
# `conda env remove` issue)
conda remove --all -q -y -n $CONDA_ENV

echo
echo "[create env]"
time conda env create -q -n "${CONDA_ENV}" --file="${ENV_FILE}" || exit 1

# Activate first
set +v
source activate $CONDA_ENV
set -v

# remove any installed pandas package
# w/o removing anything else
echo
echo "[removing installed pandas]"
conda remove pandas -y --force
pip uninstall -y pandas

echo
echo "[no installed pandas]"
conda list pandas

# # Install the compiler toolchain
# if [[ $(uname) == Linux ]]; then
# if [[ "$CONDA_SUBDIR" == "linux-32" || "$BITS32" == "yes" ]] ; then
# $CONDA_INSTALL gcc_linux-32 gxx_linux-32
# else
# $CONDA_INSTALL gcc_linux-64 gxx_linux-64
# fi
# elif [[ $(uname) == Darwin ]]; then
# $CONDA_INSTALL clang_osx-64 clangxx_osx-64
# # Install llvm-openmp and intel-openmp on OSX too
# $CONDA_INSTALL llvm-openmp intel-openmp
# fi
Loading