-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
87 lines (71 loc) · 2.17 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
trigger:
branches:
include:
- main
# variables:
# - group: data-platform-kv
# - group: databricks
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python38:
python.version: '3.10'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'
- script: |
python -m pip install --upgrade pip setuptools wheel twine
pip install -r requirements.txt
displayName: 'Install dependencies'
- script: |
python -m flake8 ./autopipes
displayName: 'Run lint tests'
- script: |
python setup.py sdist bdist_wheel
ls dist/
displayName: 'Artifact creation'
- script: |
# export SKIP_INTEGRATION=True
# export AUTH_TYPE=MSAL
# export TENANT_ID=11111111-0000-0000-0000-000000000000
# export SP_CLIENT_ID=22222222-0000-0000-0000-000000000000
# export SP_CLIENT_SECRET=ThisIsTheSecret
# export RESOURCE_GROUP=resourcegroup
# export SUBSCRIPTION_ID=44444444-0000-0000-0000-000000000000
pip install .
pytest test/unit --junitxml=junit/test-results.xml --cov=autopipes --cov-report=xml --cov-report=html
displayName: 'Unit Tests'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
dist/**
deployment/**
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
displayName: 'Publish Build Artefacts'
- task: TwineAuthenticate@0
inputs:
externalFeeds: 'pypi'
displayName: 'Authenticate Twine'
- script: |
twine upload -r pypi --config-file $(PYPIRC_PATH) $(Build.SourcesDirectory)/dist/*
continueOnError: true
displayName: 'Publish to Artefact Store'