This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
python_package_main.yml
106 lines (84 loc) · 2.56 KB
/
python_package_main.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
parameters:
# Python Version to Use for Build
- name: pythonVersion
type: string
default: 3.8
# Artifact feed to pull custom packages from.
- name: pypiAzureArtifactFeed
type: string
default: "-"
# Publish to the public pypi.org
- name: publishToPypiOrg
type: boolean
default: false
# Minimum Coverage Percentage to Pass Tests.
- name: minimumCoverage
type: number
default: 0.85
# Whether to start a mongo test container.
- name: testMongo
type: boolean
default: false
# Whether to start a Rabbit test container.
- name: testRabbit
type: boolean
default: false
# Whether to start a Redis test container.
- name: testRedis
type: boolean
default: false
# Whether to build and publish docs.
- name: publishDocs
type: boolean
default: true
# Whether to publish docs to S3.
- name: publishDocsS3
type: boolean
default: true
jobs:
- job: 'Lint_Test_Publish'
timeoutInMinutes: 5
cancelTimeoutInMinutes: 2
pool:
vmImage: 'ubuntu-16.04'
steps:
# Setup git environment
- template: git_setup.yml
# Download python helper scripts
- template: scripts_download.yml
# Setup python environment
- template: python_setup.yml
parameters:
pythonVersion: ${{ parameters.pythonVersion }}
pypiAzureArtifactFeed: ${{ parameters.pypiAzureArtifactFeed }}
# Get Repo Name
- script: python3 $(BUILD_SCRIPTS_DIR)/get_repo_name.py
displayName: 'Get repo name'
# Run Lint
- template: python_lint.yml
# Run Tests
- template: python_test.yml
parameters:
minimumCoverage: ${{ parameters.minimumCoverage }}
testMongo: ${{parameters.testMongo}}
testRabbit: ${{parameters.testRabbit}}
testRedis: ${{parameters.testRedis}}
# Get the release version
- script: python3 $(BUILD_SCRIPTS_DIR)/get_release_version.py
displayName: 'get release version'
env:
PublishLanguage: "PYTHON"
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))
- script: |
echo 'Version: $(RELEASE_VERSION)'
displayName: 'print version'
# Publish Docs
- template: python_publish_docs.yml
parameters:
publishDocs: ${{ parameters.publishDocs }}
publishDocsS3: ${{ parameters.publishDocsS3 }}
# Publish package to pypi and master
- template: python_publish_package.yml
parameters:
publishToPypiOrg: ${{ parameters.publishToPypiOrg }}
pypiAzureArtifactFeed: ${{ parameters.pypiAzureArtifactFeed }}