-
Notifications
You must be signed in to change notification settings - Fork 215
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
80 lines (70 loc) · 2.27 KB
/
azure-pipelines.yml
File metadata and controls
80 lines (70 loc) · 2.27 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
# PR gate and branch CI for the msal Python package.
# Runs on pushes to dev, on all PRs to dev, and on a daily schedule.
# Delegates test stages to .Pipelines/template-pipeline-stages.yml with
# runPublish: false — PreBuildCheck (SDL scans) + UnitTests + E2ETests only.
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
stages:
- template: .Pipelines/template-pipeline-stages.yml
parameters:
runPublish: false
- stage: Benchmark
displayName: 'Run benchmarks'
dependsOn: E2ETests
# Only run on post-merge pushes to dev — not on PRs or scheduled runs.
condition: |
and(
succeeded('E2ETests'),
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:
vmImage: ubuntu-latest
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: .perf.baseline
- bash: |
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()
- task: PublishPipelineArtifact@1
displayName: 'Publish benchmark results'
condition: and(succeededOrFailed(), eq(variables['benchmarkFileExists'], 'true'))
inputs:
targetPath: 'benchmark.json'
artifact: 'benchmark-results'