attrs/azure-pipelines.yml

115 lines
3.0 KiB
YAML
Raw Normal View History

---
trigger:
- master
jobs:
- job: 'Test'
pool:
2019-05-31 08:12:11 +00:00
vmImage: 'ubuntu-latest'
strategy:
matrix:
Typing:
python.version: '3.7'
2019-05-31 08:31:45 +00:00
tox.env: typing
Lint:
python.version: '3.7'
2019-05-31 08:31:45 +00:00
tox.env: lint
py27:
python.version: '2.7'
2019-05-31 08:31:45 +00:00
tox.env: py27
py34:
python.version: '3.4'
2019-05-31 08:31:45 +00:00
tox.env: py34
py35:
python.version: '3.5'
2019-05-31 08:31:45 +00:00
tox.env: py35
py36:
python.version: '3.6'
2019-05-31 08:31:45 +00:00
tox.env: py36
py37:
python.version: '3.7'
2019-05-31 08:31:45 +00:00
tox.env: py37
py38:
python.version: '3.8'
tox.env: py38
2019-05-08 21:18:22 +00:00
pypy2:
python.version: 'pypy2'
2019-05-31 08:31:45 +00:00
tox.env: pypy
2019-05-08 21:18:22 +00:00
pypy3:
python.version: 'pypy3'
2019-05-31 08:31:45 +00:00
tox.env: pypy3
2019-05-08 21:18:22 +00:00
Docs:
python.version: '3.7'
2019-05-31 08:31:45 +00:00
tox.env: docs
PyPI-Description:
python.version: '3.7'
2019-05-31 08:31:45 +00:00
tox.env: pypi-description
Changelog:
python.version: '3.7'
2019-05-31 08:31:45 +00:00
tox.env: changelog
steps:
2019-05-31 15:06:58 +00:00
- task: UsePythonVersion@0
displayName: Get Python for Python tools.
inputs:
versionSpec: '3.6'
2019-05-31 15:06:58 +00:00
addToPath: false
name: pyTools
- script: $(pyTools.pythonLocation)/bin/pip install --upgrade tox
2019-05-31 15:25:34 +00:00
displayName: Install Python-based tools.
2019-05-31 15:06:58 +00:00
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
condition: not(in(variables['python.version'], '3.7', '3.8'))
displayName: Use cached Python $(python.version) for tests.
2019-05-31 17:00:48 +00:00
- script: |
sudo add-apt-repository ppa:deadsnakes
sudo apt-get update
sudo apt-get install -y --no-install-recommends python$(python.version)-dev python$(python.version)-distutils
condition: in(variables['python.version'], '3.7', '3.8')
displayName: Install Python $(python.version) from the deadsnakes PPA for tests.
2019-05-31 17:00:48 +00:00
2019-05-31 15:06:58 +00:00
- script: $(pyTools.pythonLocation)/bin/tox -e $(tox.env)
2019-05-31 08:31:45 +00:00
env:
2019-05-31 08:34:54 +00:00
TOX_AP_TEST_EXTRAS: azure-pipelines
2019-05-31 10:40:58 +00:00
displayName: run tox -e $(tox.env)
2019-05-31 10:03:07 +00:00
- script: |
2019-06-06 15:06:01 +00:00
if [ ! -f .coverage.* ]; then
echo No coverage data found.
exit 0
fi
# codecov shells out to "coverage" and avoiding 'sudo pip' allows for
# package caching.
PATH=$HOME/.local/bin:$PATH
case "$(python.version)" in
"pypy2") PY=pypy ;;
"pypy3") PY=pypy3 ;;
*) PY=python$(python.version) ;;
esac
# Python 3.8 needs an up-to-date pip.
if [ "$(python.version)" = "3.8" ]; then
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$PY get-pip.py --user
fi
$PY -m pip install --user coverage codecov
coverage combine
codecov
2019-05-31 08:12:11 +00:00
env:
CODECOV_TOKEN: $(codecov.token)
displayName: Report Coverage
condition: succeeded()