-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-pipelines.yml
71 lines (57 loc) · 1.87 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
trigger:
branches:
include:
- '*'
- refs/tags/*
exclude:
- cimetrics
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
- script: env
displayName: env
- script: pip install .
displayName: 'Install library'
- script: pip install -r dev-requirements.txt
displayName: 'Install dev dependencies'
- script: black --check cimetrics
displayName: 'Check code format'
- script: mypy -p cimetrics --ignore-missing-imports
displayName: 'Type checking'
# Your application. This step collects and uploads your metrics
# to your MongoDB instance.
- script: python app/main.py
env:
METRICS_MONGO_CONNECTION: $(METRICS_MONGO_CONNECTION)
displayName: 'Run app and collect metrics'
# This step generates a graph reporting the differences between
# your branch and the target branch.
- script: python -m cimetrics.plot
env:
METRICS_MONGO_CONNECTION: $(METRICS_MONGO_CONNECTION)
displayName: 'Plot metrics'
# This step publishes a report comment on the GitHub Request
# using GITHUB_TOKEN as authentication (use secret variables!)
- script: python -m cimetrics.github_pr
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
AZURE_BLOB_URL: $(AZURE_BLOB_URL)
AZURE_WEB_URL: $(AZURE_WEB_URL)
displayName: 'Post metrics graphs as PR comment'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: _cimetrics
artifactName: metrics
displayName: 'Publish metrics graphs as build artifact'
# Automated release of tagged commits to https://pypi.org/project/cimetrics/
- script: |
python setup.py sdist
pip install twine
twine upload -u __token__ -p $(pypi_token) dist/*
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
displayName: Automated Release to https://pypi.org/project/cimetrics/