Skip to content

Commit 2cf3a76

Browse files
authored
Azure pipelines (#22)
* Switch to using azure pipelines. * Explicitly list pytest as a third-party library. * Update azure CI link to final ID. * Correct job name.
1 parent c254fad commit 2cf3a76

File tree

12 files changed

+313
-141
lines changed

12 files changed

+313
-141
lines changed

.azure-pipelines/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
trigger:
2+
batch: true
3+
branches:
4+
include:
5+
- master
6+
tags:
7+
exclude:
8+
- '*'
9+
pr:
10+
autoCancel: true
11+
branches:
12+
include:
13+
- master
14+
15+
variables:
16+
- group: codecov
17+
18+
stages:
19+
- template: stage-lint.yml
20+
- template: stage-test.yml
21+
parameters:
22+
pythonVersions:
23+
- '3.6'
24+
- '3.7'
25+
- '3.8'
26+

.azure-pipelines/deploy.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
trigger:
2+
tags:
3+
include:
4+
- v?.*
5+
pr: none
6+
7+
8+
variables:
9+
- group: codecov
10+
- group: twine
11+
12+
13+
resources:
14+
repositories:
15+
- repository: templates
16+
type: github
17+
name: aio-libs/azure-pipelines
18+
endpoint: aio-libs
19+
20+
stages:
21+
- template: stage-lint.yml
22+
23+
- template: stage-test.yml
24+
parameters:
25+
pythonVersions:
26+
- '3.6'
27+
- '3.7'
28+
- '3.8'
29+
30+
- template: stage-deploy.yml
31+
parameters:
32+
pythonVersions:
33+
- '3.6'
34+
- '3.7'
35+
- '3.8'
36+
37+
- template: templates/stage-publish.yml@templates
38+
parameters:
39+
github: release-upload

.azure-pipelines/stage-deploy.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
parameters:
2+
pythonVersions: []
3+
operatingSystems:
4+
- 'Linux'
5+
- 'Windows'
6+
- 'Mac'
7+
8+
stages:
9+
- stage: build
10+
displayName: 'Build'
11+
12+
jobs:
13+
- job: distributions
14+
displayName: 'Create distributions'
15+
pool:
16+
vmImage: 'ubuntu-latest'
17+
18+
steps:
19+
- template: templates/step-build.yml@templates
20+
parameters:
21+
steps:
22+
- script: |
23+
python setup.py sdist bdist_wheel
24+
displayName: 'Make tarball and universal wheel'
25+

.azure-pipelines/stage-lint.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
stages:
2+
- stage: lint
3+
displayName: 'Lint'
4+
5+
jobs:
6+
- job: 'flake8'
7+
pool:
8+
vmImage: 'ubuntu-latest'
9+
10+
steps:
11+
- checkout: self
12+
clean: true
13+
14+
- task: UsePythonVersion@0
15+
inputs:
16+
versionSpec: '3.7'
17+
architecture: 'x64'
18+
19+
- script: |
20+
pip install -r requirements/flake.txt
21+
displayName: 'Install deps'
22+
23+
- script: |
24+
make flake8
25+
displayName: 'Run flake8'
26+
27+
- job: 'isort'
28+
pool:
29+
vmImage: 'ubuntu-latest'
30+
31+
steps:
32+
- checkout: self
33+
clean: true
34+
35+
- task: UsePythonVersion@0
36+
inputs:
37+
versionSpec: '3.7'
38+
architecture: 'x64'
39+
40+
- script: |
41+
pip install -e .
42+
displayName: 'Install itself'
43+
44+
- script: |
45+
pip install -r requirements/flake.txt
46+
displayName: 'Install deps'
47+
48+
- script: |
49+
make isort-check
50+
displayName: 'Run isort checker'
51+
52+
- job: 'mypy'
53+
pool:
54+
vmImage: 'ubuntu-latest'
55+
56+
steps:
57+
- checkout: self
58+
clean: true
59+
60+
- task: UsePythonVersion@0
61+
inputs:
62+
versionSpec: '3.7'
63+
architecture: 'x64'
64+
65+
- script: |
66+
pip install -r requirements/ci.txt
67+
displayName: 'Install deps'
68+
69+
- script: |
70+
pip install -e .
71+
displayName: 'Install itself'
72+
73+
- script: |
74+
make mypy
75+
displayName: 'Run mypy checker'
76+
77+
- job: 'docs'
78+
pool:
79+
vmImage: 'ubuntu-latest'
80+
81+
steps:
82+
- checkout: self
83+
clean: true
84+
85+
- task: UsePythonVersion@0
86+
inputs:
87+
versionSpec: '3.7'
88+
architecture: 'x64'
89+
90+
- script: |
91+
apt install libenchant-dev
92+
pip install -r requirements/doc-spelling.txt
93+
pip install -r requirements/towncrier.txt
94+
displayName: 'Install deps'
95+
96+
- script: |
97+
towncrier --yes
98+
make doc
99+
displayName: 'Run docs checker'
100+
101+
- job: 'twine'
102+
pool:
103+
vmImage: 'ubuntu-latest'
104+
105+
steps:
106+
- checkout: self
107+
clean: true
108+
109+
- task: UsePythonVersion@0
110+
inputs:
111+
versionSpec: '3.7'
112+
architecture: 'x64'
113+
114+
- script: |
115+
pip install -U twine wheel
116+
python setup.py sdist bdist_wheel
117+
displayName: 'Install deps and create pure-python distributions'
118+
119+
- script: |
120+
twine check dist/*
121+
displayName: 'Run twine checker'
122+
123+
- job: 'contributors'
124+
pool:
125+
vmImage: 'ubuntu-latest'
126+
127+
steps:
128+
- script: |
129+
LC_ALL=C sort -c CONTRIBUTORS.txt
130+
displayName: 'Making sure that CONTRIBUTORS.txt remains sorted'

.azure-pipelines/stage-test.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
parameters:
2+
pythonVersions: []
3+
operatingSystems:
4+
- 'Linux'
5+
- 'Windows'
6+
- 'Mac'
7+
8+
stages:
9+
- stage: test
10+
displayName: 'Run tests'
11+
12+
jobs:
13+
- job:
14+
15+
strategy:
16+
matrix:
17+
${{ each py in parameters.pythonVersions }}:
18+
${{ each os in parameters.operatingSystems }}:
19+
${{ format('Py{0} {1}', py, os) }}:
20+
python.version: ${{ py }}
21+
${{ if eq(os, 'Linux') }}:
22+
image: 'ubuntu-latest'
23+
${{ if eq(os, 'Windows') }}:
24+
image: 'windows-latest'
25+
${{ if eq(os, 'Mac') }}:
26+
image: 'macos-latest'
27+
28+
pool:
29+
vmImage: '$(image)'
30+
31+
timeoutInMinutes: 10
32+
33+
steps:
34+
- checkout: self
35+
clean: true
36+
37+
- task: UsePythonVersion@0
38+
inputs:
39+
versionSpec: '$(python.version)'
40+
architecture: 'x64'
41+
42+
- script: |
43+
python -m pip install --upgrade pip setuptools
44+
displayName: 'Update pip'
45+
46+
- script: |
47+
pip install -r requirements/dev.txt pytest-azurepipelines
48+
displayName: 'Install dependencies'
49+
50+
- script: |
51+
pytest tests -vv --no-coverage-upload
52+
displayName: 'pytest'
53+
54+
- script: |
55+
python -m coverage xml
56+
displayName: 'Prepare coverage'
57+
58+
- script: |
59+
pip install codecov
60+
python -m codecov -f coverage.xml -X gcov
61+
env:
62+
CODECOV_TOKEN: $(codecov.token)
63+
condition: and(variables['codecov.token'], succeeded())
64+
displayName: 'Upload coverage reports'

0 commit comments

Comments
 (0)