diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6f401c6..32c0552 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,36 +1,88 @@ -# Python package -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python +# from matplotlib's azure setup + + +schedules: +- cron: "0 0 * * 4" + displayName: Weekly build + branches: + include: + - releases/* + always: true + trigger: -- master - -pool: - vmImage: ubuntu-latest -strategy: - matrix: - Python27: - python.version: '2.7' - Python35: - python.version: '3.5' - Python36: - python.version: '3.6' - Python37: - python.version: '3.7' - -steps: -- task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - displayName: 'Use Python $(python.version)' - -- script: | - python -m pip install --upgrade pip - pip install -r requirements.txt - displayName: 'Install dependencies' - -- script: | - pip install pytest pytest-azurepipelines - pytest - displayName: 'pytest' + tags: + include: + - '*' + branches: + include: + - '*' + + +variables: + PIP_CACHE_DIR: $(Pipeline.Workspace)/cache/pip + + +jobs: +- job: 'static_checks' + pool: + vmImage: ubuntu-16.04 + variables: + TOXENV: flake8,pylint,docs,doctest,check-manifest,checkreadme + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.8' + architecture: 'x64' + - script: | + pip install tox + displayName: Install tox + - script: | + tox + displayName: tox + +- job: 'ubuntu1604' + pool: + vmImage: ubuntu-16.04 + strategy: + matrix: + py36: + python.version: '3.6' + TOXENV: py36 + py37: + python.version: '3.7' + TOXENV: py37 + py38: + python.version: '3.8' + TOXENV: py38 + py39: + python.version: '3.9' + TOXENV: py39 + maxParallel: 4 + + steps: + - template: ci/azure-pipelines-steps.yml + parameters: + platform: linux + +- job: 'macOS1015' + pool: + vmImage: macOS-10.15 + strategy: + matrix: + py37: + python.version: '3.7' + TOXENV: py37 + py38: + python.version: '3.8' + TOXENV: py38 + py39: + python.version: '3.9' + TOXENV: py39 + maxParallel: 4 + + steps: + - template: ci/azure-pipelines-steps.yml + parameters: + platform: macos + diff --git a/bors.toml b/bors.toml new file mode 100644 index 0000000..e4fc4ea --- /dev/null +++ b/bors.toml @@ -0,0 +1,6 @@ +status = [ + "aragilar.pytest-info-collector", + "codecov/patch", + "codecov/project", +] + diff --git a/ci/azure-pipelines-steps.yml b/ci/azure-pipelines-steps.yml new file mode 100644 index 0000000..831c65d --- /dev/null +++ b/ci/azure-pipelines-steps.yml @@ -0,0 +1,38 @@ +steps: +- task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + architecture: 'x64' + displayName: 'Use Python $(python.version)' + condition: and(succeeded(), ne(variables['python.version'], 'Pre')) + +- script: | + python -m pip install --upgrade pip + pip install tox codecov twine wheel + displayName: 'Install pip dependencies' + +- task: TwineAuthenticate@0 + inputs: + externalFeeds: 'pypi' + condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/') + +- script: env + displayName: 'print env' + +- script: | + tox + displayName: 'tox' + +#- script: | +# codecov +# displayName: 'codecov' +# hopefully the bash uploader will work +- script: | + bash <(curl -s https://codecov.io/bash) + displayName: 'Upload to codecov.io' + +- script: | + python setup.py sdist bdist_wheel + twine upload --skip-existing -r pypi --config-file $(PYPIRC_PATH) dist/* + displayName: 'Upload to PyPI' + condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')