Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add azurepipelines #4157

Merged
merged 2 commits into from
Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .azure-pipelines/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
trigger:
batch: true
branches:
include:
- master
exclude:
- refs/tags/*
pr:
autoCancel: true
branches:
include:
- master

variables:
- group: codecov

stages:
- template: stage-lint.yml
- template: stage-test.yml
parameters:
codecov.token: '$(codecov.token)'
129 changes: 129 additions & 0 deletions .azure-pipelines/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
trigger:
branches:
include:
- refs/tags/*
pr: none


variables:
- group: codecov
- group: twine


resources:
containers:
- container: manylinux
image: quay.io/pypa/manylinux1_x86_64
repositories:
- repository: templates
type: github
name: aio-libs/azure-pipelines
endpoint: aio-libs

stages:
- template: stage-lint.yml

- template: stage-test.yml
parameters:
codecov.token: '$(codecov.token)'

- stage: build
displayName: 'Build'

jobs:
- job: tarball
displayName: 'Tarball'
pool:
vmImage: 'ubuntu-latest'

steps:
- template: templates/step-build.yml@templates
parameters:
steps:
- script: |
make cythonize
displayName: 'Cythonize'
- script: |
python setup.py sdist
displayName: 'Make tarball'

- job: manylinux
displayName: 'Manylinux'
strategy:
matrix:
py36 x64:
python.code: 'cp36-cp36m'
manylinux: 'manylinux_64'
py37 x64:
python.code: 'cp37-cp37m'
manylinux: 'manylinux_64'
pool:
vmImage: 'ubuntu-latest'
container: manylinux
steps:
- script: |
/opt/python/$(python.code)/bin/python -m venv .build-venv
displayName: 'Use Python $(python.code)'

- script: |
source .build-venv/bin/activate
pip install -U setuptools wheel
displayName: 'Install tools'

- script: |
source .build-venv/bin/activate
make cythonize
python setup.py bdist_wheel
displayName: 'Make wheel'

- script: |
auditwheel repair dist/*.whl --wheel-dir wheelhouse/
displayName: 'Repair wheel'

- template: templates/step-store-dist.yml@templates
parameters:
folder: wheelhouse

- job:
strategy:
matrix:
Win py36 x64:
python.version: '3.6'
python.architecture: 'x64'
image: 'windows-latest'
Win py37 x64:
python.version: '3.7'
python.architecture: 'x64'
image: 'windows-latest'
Win py36 x86:
python.version: '3.6'
python.architecture: 'x86'
image: 'windows-latest'
Win py37 x86:
python.version: '3.7'
python.architecture: 'x86'
image: 'windows-latest'
Mac py36:
python.version: '3.6'
image: 'macos-latest'
python.architecture: 'x64'
Mac py37:
python.version: '3.7'
image: 'macos-latest'
python.architecture: 'x64'
pool:
vmImage: '$(image)'
steps:
- template: templates/step-build.yml@templates
parameters:
python: '$(python.version)'
architecture: '$(python.architecture)'
steps:
- script: |
make cythonize
python setup.py bdist_wheel
displayName: 'Make wheel'

- template: templates/stage-publish.yml@templates
parameters:
github: release-upload
106 changes: 106 additions & 0 deletions .azure-pipelines/stage-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
stages:
- stage: lint
displayName: 'Run linters'

jobs:
- job: 'flake8'
pool:
vmImage: 'ubuntu-latest'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
architecture: 'x64'

- script: |
pip install -r requirements/lint.txt
displayName: 'Install deps'

- script: |
make flake8
displayName: 'Run flake8'

- job: 'black'
pool:
vmImage: 'ubuntu-latest'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
architecture: 'x64'

- script: |
pip install -r requirements/lint.txt
displayName: 'Install deps'

- script: |
make black-check
displayName: 'Run black checker'

- job: 'mypy'
pool:
vmImage: 'ubuntu-latest'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
architecture: 'x64'

- script: |
pip install -r requirements/lint.txt
displayName: 'Install deps'

- script: |
pip install -e .
displayName: 'Install itself'
env:
AIOHTTP_NO_EXTENSIONS: 1

- script: |
make mypy
displayName: 'Run black checker'

- job: 'docs'
pool:
vmImage: 'ubuntu-latest'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
architecture: 'x64'

- script: |
apt install libenchant-dev
pip install -r requirements/doc-spelling.txt
displayName: 'Install deps'

- script: |
make doc
displayName: 'Run docs checker'
env:
AIOHTTP_NO_EXTENSIONS: 1

- job: 'twine'
pool:
vmImage: 'ubuntu-latest'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
architecture: 'x64'

- script: |
pip install -U twine wheel
python setup.py sdist bdist_wheel
displayName: 'Install deps'
env:
AIOHTTP_NO_EXTENSIONS: 1

- script: |
twine check dist/*
displayName: 'Run twine checker'
83 changes: 83 additions & 0 deletions .azure-pipelines/stage-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
parameters:
codecov.token: ''

stages:
- stage: test
displayName: 'Run tests'

jobs:
- job:
strategy:
matrix:
Py36-Cython-Linux:
python.version: '3.6'
no_extensions: ''
image: 'ubuntu-latest'
Py37-Cython-Linux:
python.version: '3.7'
no_extensions: ''
image: 'ubuntu-latest'
Py36-Pure-Linux:
python.version: '3.6'
no_extensions: 'Y'
image: 'ubuntu-latest'
Py37-Pure-Linux:
python.version: '3.7'
no_extensions: 'Y'
image: 'ubuntu-latest'
# PyPy3-Linux:
# python.version: 'pypy3'
# no_extensions: 'Y'
# image: 'ubuntu-latest'
Py36-Cython-Win:
python.version: '3.6'
no_extensions: ''
image: 'windows-latest'
Py37-Cython-Win:
python.version: '3.7'
no_extensions: ''
image: 'windows-latest'
Py36-Cython-Mac:
python.version: '3.6'
no_extensions: ''
image: 'macos-latest'
Py37-Cython-Mac:
python.version: '3.7'
no_extensions: ''
image: 'macos-latest'
pool:
vmImage: '$(image)'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'

- script: |
python -m pip install --upgrade pip
displayName: 'Update pip'

- script: |
make cythonize
condition: eq(variables['no_extensions'], '')
displayName: 'Cythonize'

- script: |
pip install -r requirements/dev.txt
displayName: 'Install dependencies'
env:
AIOHTTP_NO_EXTENSIONS: '$(no_extensions)'

- script: |
pytest tests -vv
python -m coverage xml
displayName: 'pytest'

- script: |
pip install codecov
python -m codecov -f coverage.xml -X gcov
displayName: 'Upload coverage reports'
condition: ne(variables['codecov.token'], '')
env:
CODECOV_TOKEN: '$(codecov.token)'