pyqtgraph/azure-pipelines.yml

113 lines
2.8 KiB
YAML
Raw Normal View History

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'
DEFAULT_MERGE_BRANCH: 'master'
disable.coverage.autogenerate: 'true'
stages:
- stage: pre_build
jobs:
- job: check_diff_size
pool:
2020-02-21 17:28:48 +00:00
vmImage: 'Ubuntu 18.04'
steps:
- bash: |
git config --global advice.detachedHead false
mkdir ~/repo-clone && cd ~/repo-clone
git init
git remote add -t $(Build.SourceBranchName) origin $(Build.Repository.Uri)
git remote add -t ${DEFAULT_MERGE_BRANCH} upstream https://github.com/${OFFICIAL_REPO}.git
git fetch origin $(Build.SourceBranchName)
git fetch upstream ${DEFAULT_MERGE_BRANCH}
git checkout $(Build.SourceBranchName)
MERGE_SIZE=`du -s . | sed -e "s/\t.*//"`
echo -e "Merge Size ${MERGE_SIZE}"
git checkout ${DEFAULT_MERGE_BRANCH}
TARGET_SIZE=`du -s . | sed -e "s/\t.*//"`
echo -e "Target Size ${TARGET_SIZE}"
if [ "${MERGE_SIZE}" != "${TARGET_SIZE}" ]; then
SIZE_DIFF=`expr \( ${MERGE_SIZE} - ${TARGET_SIZE} \)`;
else
SIZE_DIFF=0;
fi;
echo -e "Estimated content size difference = ${SIZE_DIFF} kB" &&
test ${SIZE_DIFF} -lt 100;
displayName: 'Diff Size Check'
- job: "style_check"
pool:
2020-02-21 17:28:48 +00:00
vmImage: "Ubuntu 18.04"
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: 3.7
- bash: |
pip install flake8
python setup.py style
displayName: 'flake8 check'
- job: "build_docs"
pool:
vmImage: 'Ubuntu 18.04'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: 3.8
- script: |
cd doc
python -m pip install -r requirements.txt
make html SPHINXOPTS='-W -v'
displayName: "Build docs"
- stage: build
dependsOn: []
jobs:
- job: "build_wheel"
pool:
2020-02-21 17:28:48 +00:00
vmImage: 'Ubuntu 18.04'
steps:
- task: UsePythonVersion@0
inputs:
2020-02-21 17:28:48 +00:00
versionSpec: 3.8
- script: |
python -m pip install setuptools wheel
python setup.py bdist_wheel --universal
displayName: "Build Python Wheel"
continueOnError: false
- publish: dist
artifact: wheel
- stage: test
displayName: "Test Suite"
dependsOn: build
jobs:
- template: azure-test-template.yml
parameters:
name: linux
2020-02-21 17:28:48 +00:00
vmImage: 'Ubuntu 18.04'
- template: azure-test-template.yml
parameters:
name: windows
2020-02-21 17:28:48 +00:00
vmImage: 'windows-2019'
- template: azure-test-template.yml
parameters:
name: macOS
vmImage: 'macOS-10.15'