2019-05-22 22:24:21 +00:00
|
|
|
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'
|
2019-08-29 20:56:25 +00:00
|
|
|
DEFAULT_MERGE_BRANCH: 'develop'
|
2020-02-22 00:24:33 +00:00
|
|
|
disable.coverage.autogenerate: 'true'
|
2019-08-29 20:56:25 +00:00
|
|
|
|
|
|
|
stages:
|
|
|
|
- stage: "pre_test"
|
|
|
|
jobs:
|
|
|
|
- job: check_diff_size
|
|
|
|
pool:
|
2020-02-21 17:28:48 +00:00
|
|
|
vmImage: 'Ubuntu 18.04'
|
2019-08-29 20:56:25 +00:00
|
|
|
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}"
|
2019-05-22 22:24:21 +00:00
|
|
|
|
2019-08-29 20:56:25 +00:00
|
|
|
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'
|
|
|
|
continueOnError: true
|
|
|
|
|
|
|
|
- job: "style_check"
|
|
|
|
pool:
|
2020-02-21 17:28:48 +00:00
|
|
|
vmImage: "Ubuntu 18.04"
|
2019-08-29 20:56:25 +00:00
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: 3.7
|
|
|
|
- bash: |
|
|
|
|
pip install flake8
|
|
|
|
python setup.py style
|
|
|
|
displayName: 'flake8 check'
|
|
|
|
continueOnError: true
|
|
|
|
|
|
|
|
- job: "build_wheel"
|
|
|
|
pool:
|
2020-02-21 17:28:48 +00:00
|
|
|
vmImage: 'Ubuntu 18.04'
|
2019-08-29 20:56:25 +00:00
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
2020-02-21 17:28:48 +00:00
|
|
|
versionSpec: 3.8
|
2019-08-29 20:56:25 +00:00
|
|
|
- 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"
|
|
|
|
jobs:
|
2019-05-22 22:24:21 +00:00
|
|
|
- template: azure-test-template.yml
|
|
|
|
parameters:
|
2019-08-29 20:56:25 +00:00
|
|
|
name: linux
|
2020-02-21 17:28:48 +00:00
|
|
|
vmImage: 'Ubuntu 18.04'
|
2019-05-22 22:24:21 +00:00
|
|
|
- template: azure-test-template.yml
|
|
|
|
parameters:
|
2019-08-29 20:56:25 +00:00
|
|
|
name: windows
|
2020-02-21 17:28:48 +00:00
|
|
|
vmImage: 'windows-2019'
|
2019-05-22 22:24:21 +00:00
|
|
|
- template: azure-test-template.yml
|
|
|
|
parameters:
|
2019-08-29 20:56:25 +00:00
|
|
|
name: macOS
|
2020-02-21 17:28:48 +00:00
|
|
|
vmImage: 'macOS-10.15'
|