-
Notifications
You must be signed in to change notification settings - Fork 223
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
131 lines (117 loc) · 3.95 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
131 lines (117 loc) · 3.95 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#################################################################################
# OneBranch Pipelines - PR Gate and CI #
# Runs on pushes to dev, on all PRs to dev, and on a daily schedule. #
# Documentation: https://aka.ms/obpipelines #
# Yaml Schema: https://aka.ms/obpipelines/yaml/schema #
#################################################################################
trigger:
branches:
include:
- dev
pr:
branches:
include:
- dev
drafts: false
schedules:
- cron: '45 7 * * *' # 07:45 UTC daily (11:45 PM PST / 12:45 AM PDT)
displayName: 'Daily CI (dev)'
branches:
include:
- dev
always: false # only run when there are new changes
parameters:
- name: debug
displayName: 'Enable debug output (system.debug)'
type: boolean
default: false
variables:
CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)]
system.debug: ${{ parameters.debug }}
resources:
repositories:
- repository: templates
type: git
name: OneBranch.Pipelines/GovernedTemplates
ref: refs/heads/main
extends:
template: v2/OneBranch.NonOfficial.CrossPlat.yml@templates
parameters:
globalSdl:
asyncSdl:
enabled: false
tsa:
enabled: true
breakOnFailure: true
credscan:
suppressionsFile: $(Build.SourcesDirectory)/.Pipelines/credscan-exclusion.json
policheck:
break: true
codeql:
compiled:
enabled: false
interpretedLanguages: python
tsaEnabled: true
featureFlags:
EnableCDPxPAT: false
stages:
- template: .Pipelines/template-pipeline-stages.yml
parameters:
runPublish: false
- stage: Benchmark
displayName: 'Run benchmarks'
dependsOn: E2ETests
# Run on post-merge pushes to dev, or on manual builds when forceBenchmarks=true.
condition: |
and(
succeeded('E2ETests'),
or(
and(
eq(variables['Build.Reason'], 'Manual'),
in(variables['forceBenchmarks'], 'true', 'True')
),
and(
eq(variables['Build.SourceBranch'], 'refs/heads/dev'),
or(
eq(variables['Build.Reason'], 'IndividualCI'),
eq(variables['Build.Reason'], 'BatchedCI'),
eq(variables['Build.Reason'], 'Manual')
)
)
)
)
jobs:
- job: Benchmark
displayName: 'Performance benchmarks (Python 3.9)'
pool:
type: linux
isCustom: true
vmImage: 'ubuntu-22.04'
variables:
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9'
displayName: 'Set up Python 3.9'
- script: |
python -m pip install --upgrade pip
pip install pytest -r requirements.txt
displayName: 'Install dependencies'
- task: Cache@2
displayName: 'Restore performance baseline cache'
inputs:
key: 'perf-baseline | "$(Agent.OS)" | tests/test_benchmark.py'
path: $(System.DefaultWorkingDirectory)/.perf-baseline
- bash: |
mkdir -p $(System.DefaultWorkingDirectory)/.perf-baseline
pytest --benchmark-only --benchmark-json benchmark.json --log-cli-level INFO tests/test_benchmark.py
displayName: 'Run benchmarks'
- bash: |
[ -f benchmark.json ] && echo "##vso[task.setvariable variable=benchmarkFileExists]true"
displayName: 'Check benchmark output exists'
condition: succeededOrFailed()
- bash: |
[ -f benchmark.json ] && cp benchmark.json $(ob_outputDirectory)/
displayName: 'Copy benchmark results to output'
condition: and(succeededOrFailed(), eq(variables['benchmarkFileExists'], 'true'))