Implement azure ci (#865)

* [skip-ci] Initial Azure-Pipelines configuration.

The following configurations are tested

* macOS 10.13
* ubuntu 16.04
* Windows Server 2016

Under each operating system, the following Qt bindings are tested

* conda based pyqt4
* conda based pyside
* conda based pyside2 (5.6)
* conda based PyQt5 (5.9)
* pip basedd PyQt5 (5.12)
* pip based PySide2 (5.12)

For each configuration, it runs `python -m pytest --cov pyqtgraph -sv`

The only configuration that actually passes all tests is Ubuntu-pip-PyQt5
This commit is contained in:
Ogi Moore 2019-05-22 15:24:21 -07:00 committed by GitHub
parent 04927dd3cf
commit 9cb351feee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 221 additions and 0 deletions

38
azure-pipelines.yml Normal file
View File

@ -0,0 +1,38 @@
############################################################################################
# This config was rectrieved in no small part from https://github.com/slaclab/pydm
############################################################################################
trigger:
branches:
include:
- '*' # Build for all branches if they have a azure-pipelines.yml file.
tags:
include:
- 'v*' # Ensure that we are building for tags starting with 'v' (Official Versions)
# Build only for PRs for master branch
pr:
autoCancel: true
branches:
include:
- master
- develop
variables:
OFFICIAL_REPO: 'pyqtgraph/pyqtgraph'
jobs:
- template: azure-test-template.yml
parameters:
name: Linux
vmImage: 'Ubuntu 16.04'
- template: azure-test-template.yml
parameters:
name: Windows
vmImage: 'vs2017-win2016'
- template: azure-test-template.yml
parameters:
name: MacOS
vmImage: 'macOS-10.13'

183
azure-test-template.yml Normal file
View File

@ -0,0 +1,183 @@
# Azure Pipelines CI job template for PyDM Tests
# https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/anaconda?view=azure-devops
parameters:
name: ''
vmImage: ''
jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
Python27-Qt4:
python.version: '2.7'
install.method: "conda"
qt.bindings: "pyqt=4"
Python27-PySide:
python.version: '2.7'
qt.bindings: "pyside"
install.method: "conda"
Python37-PyQt-5.9:
python.version: "3.7"
qt.bindings: "pyqt"
install.method: "conda"
Python37-PySide2-5.6:
python.version: "3.7"
qt.bindings: "pyside2"
install.method: "conda"
Python35-PyQt-5.12:
python.version: '3.5'
qt.bindings: "PyQt5"
install.method: "pip"
Python35-PySide2-5.12:
python.version: "3.5"
qt.bindings: "PySide2"
install.method: "pip"
steps:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: 'Windows - Add conda to PATH'
condition: and(eq(variables['install.method'], 'conda' ), eq(variables['agent.os'], 'Windows_NT' ))
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
sudo chown -R $USER $CONDA
displayName: 'MacOS - Add conda to PATH'
condition: and(eq(variables['install.method'], 'conda' ), eq(variables['agent.os'], 'Darwin' ))
- bash: |
brew update && brew install azure-cli
brew update && brew install python3 && brew upgrade python3
brew link --overwrite python3
displayName: "MacOS - Intall Python3"
condition: and(eq(variables['install.method'], 'pip' ), eq(variables['agent.os'], 'Darwin' ))
- bash: |
echo "##vso[task.prependpath]/usr/share/miniconda/bin"
displayName: 'Linux - Add conda to PATH'
condition: and(eq(variables['install.method'], 'conda' ), eq(variables['agent.os'], 'Linux' ))
- bash: |
# Install & Start Windows Manager for Linux
sudo apt-get install -y xvfb libxkbcommon-x11-0 # herbstluftwm
displayName: 'Linux - Prepare OS'
condition: eq(variables['agent.os'], 'Linux' )
- bash: |
source $HOME/miniconda/etc/profile.d/conda.sh
hash -r
conda config --set always_yes yes --set auto_update_conda no
conda config --add channels conda-forge
conda create -n test_env --quiet python=$(python.version)
displayName: 'Conda Setup Test Environment'
condition: eq(variables['install.method'], 'conda' )
- script: |
call activate test_env
conda install --quiet $(qt.bindings)
conda install --quiet numpy scipy pyopengl pytest flake8 six coverage
pip install pytest-azurepipelines pytest-xdist pytest-cov
displayName: Conda Install Dependencies - Windows
condition: and(eq(variables['install.method'], 'conda' ), eq(variables['agent.os'], 'Windows_NT' ))
- bash: |
source activate test_env
conda install --quiet $(qt.bindings)
conda install --quiet numpy scipy pyopengl pytest flake8 six coverage
pip install pytest-azurepipelines pytest-xdist pytest-cov pytest-xvfb
displayName: Conda Install Dependencies - MacOS+Linux
condition: and(eq(variables['install.method'], 'conda' ), ne(variables['agent.os'], 'Windows_NT' ))
- bash: |
pip3 install setuptools wheel
pip3 install $(qt.bindings)
pip3 install numpy scipy pyopengl pytest flake8 six coverage
pip3 install pytest-azurepipelines pytest-xdist pytest-cov pytest-xvfb
displayName: "Pip - Install Dependencies"
condition: eq(variables['install.method'], 'pip' )
- bash: |
source activate test_env
echo python location: `which python3`
echo python version: `python3 --version`
echo pytest location: `which pytest`
echo installed packages
conda list
echo pyqtgraph system info
python -c "import pyqtgraph as pg; pg.systemInfo()"
displayName: 'Debug - Conda/MacOS+Linux'
continueOnError: false
condition: and(eq(variables['install.method'], 'conda' ), ne(variables['agent.os'], 'Windows_NT' ))
- script: |
call activate test_env
echo python location
where python
echo python version
python --version
echo pytest location
where pytest
echo installed packages
conda list
echo pyqtgraph system info
python -c "import pyqtgraph as pg; pg.systemInfo()"
displayName: 'Debug - Conda/Windows'
continueOnError: false
condition: and(eq(variables['install.method'], 'conda' ), eq(variables['agent.os'], 'Windows_NT' ))
- bash: |
echo python location: `which python3`
echo python version: `python3 --version`
echo pytest location: `which pytest`
echo installed packages
pip3 list
echo pyqtgraph system info
python3 -c "import pyqtgraph as pg; pg.systemInfo()"
displayName: 'Debug - System/MacOS+Linux'
continueOnError: false
condition: and(eq(variables['install.method'], 'pip' ), ne(variables['agent.os'], 'Windows_NT' ))
- bash: |
echo python location: `where python`
echo python version: `python --version`
echo pytest location: `where pytest`
echo installed packages
python -m pip list
echo pyqtgraph system info
python -c "import pyqtgraph as pg; pg.systemInfo()"
displayName: 'Debug - System/Windows'
continueOnError: false
condition: and(eq(variables['install.method'], 'pip' ), eq(variables['agent.os'], 'Windows_NT' ))
- bash: python3 -m pytest --cov pyqtgraph -sv --test-run-title="Tests for $(Agent.OS) - Python $(python.version) - Install Method $(install.method)- Bindings $(qt.bindings)" --napoleon-docstrings
displayName: 'Tests - Run - Pip/MacOS+Linux'
continueOnError: false
env:
DISPLAY: :99.0
condition: and(eq(variables['install.method'], 'pip' ), ne(variables['agent.os'], 'Windows_NT' ))
- bash: python -m pytest --cov pyqtgraph -sv --test-run-title="Tests for $(Agent.OS) - Python $(python.version) - Install Method $(install.method)- Bindings $(qt.bindings)" --napoleon-docstrings
displayName: 'Tests - Run - Pip/Windows'
continueOnError: false
env:
DISPLAY: :99.0
condition: and(eq(variables['install.method'], 'pip' ), eq(variables['agent.os'], 'Windows_NT' ))
- bash: |
source activate test_env
pytest --cov pyqtgraph -sv --test-run-title="Tests for $(Agent.OS) - Python $(python.version) - Install Method $(install.method)- Bindings $(qt.bindings)" --napoleon-docstrings
displayName: 'Tests - Run - Conda/MacOS+Linux'
continueOnError: false
env:
DISPLAY: :99.0
condition: and(eq(variables['install.method'], 'conda' ), ne(variables['agent.os'], 'Windows_NT' ))
- script: |
call activate test_env
python -m pytest --cov pyqtgraph -sv --test-run-title="Tests for $(Agent.OS) - Python $(python.version) - Install Method $(install.method)- Bindings $(qt.bindings)" --napoleon-docstrings
displayName: 'Tests - Run - Conda/Windows'
continueOnError: false
env:
DISPLAY: :99.0
condition: and(eq(variables['install.method'], 'conda' ), eq(variables['agent.os'], 'Windows_NT' ))