1f76ac0e2c
* Add a docs build job to CI * Add sphinxopts to fail on warning * Test sphinx warning * Redid ci stage conditionals * update conf.py to remove deprecation warning * introduce 3rd stage for proper conditionals * Attempt to fix malformed table Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
113 lines
2.8 KiB
YAML
113 lines
2.8 KiB
YAML
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:
|
|
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:
|
|
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:
|
|
vmImage: 'Ubuntu 18.04'
|
|
steps:
|
|
- task: UsePythonVersion@0
|
|
inputs:
|
|
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
|
|
vmImage: 'Ubuntu 18.04'
|
|
- template: azure-test-template.yml
|
|
parameters:
|
|
name: windows
|
|
vmImage: 'windows-2019'
|
|
- template: azure-test-template.yml
|
|
parameters:
|
|
name: macOS
|
|
vmImage: 'macOS-10.15' |