-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
102 lines (94 loc) · 3.1 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
102 lines (94 loc) · 3.1 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
# Don't run build jobs for branches
trigger:
batch: false
branches:
include:
- gh-readonly-queue/*
# Still allow PR builds to run against main
pr:
- main
stages:
- stage: check
jobs:
- job: skip
pool:
vmImage: 'ubuntu-22.04'
variables:
DECODE_PERCENTS: 'false'
RET: 'true'
steps:
- checkout: self
# We only need two: the PR merge commit, and the actual commit added by the user
fetchDepth: '2'
- bash: |
git_log=`git log --max-count=1 --skip=1 --pretty=format:"%B" | tr "\n" " "`
echo "##vso[task.setvariable variable=log]$git_log"
displayName: Obtain commit message
- bash: echo "##vso[task.setvariable variable=RET]false"
condition: or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]'))
displayName: Skip build?
- bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET"
name: result
displayName: Export result
- stage: build
condition: and(succeeded(), eq(dependencies.check.outputs['skip.result.start_main'], 'true'))
dependsOn: check
jobs:
- job: fast_finish
displayName: fast finish
pool:
vmImage: 'ubuntu-22.04'
steps:
- script: |
./.scripts/fast_finish.sh
name: fast_finish
displayName: Fast finish
env:
CI: azure
- template: ./.azure-pipelines/azure-pipelines-linux.yml
- template: ./.azure-pipelines/azure-pipelines-osx.yml
- template: ./.azure-pipelines/azure-pipelines-win.yml
- job: status
pool:
vmImage: 'ubuntu-22.04'
dependsOn:
- fast_finish
- win_64
- osx
- linux_64
- linux_64_cuda_129
- linux_64_cuda_130
condition: always()
variables:
win_64: $[ dependencies.win_64.result ]
osx: $[ dependencies.osx.result ]
linux_64: $[ dependencies.linux_64.result ]
linux_64_cuda_129: $[ dependencies.linux_64_cuda_129.result ]
linux_64_cuda_130: $[ dependencies.linux_64_cuda_130.result ]
steps:
- checkout: none
- bash: |
# a build is successful if any of the jobs succeeds or all are skipped
echo "linux_64 status: ${LINUX_64}"
echo "linux_64_cuda_129 status: ${LINUX_64_CUDA_129}"
echo "linux_64_cuda_130 status: ${LINUX_64_CUDA_130}"
echo "osx status: ${OSX}"
echo "win_64 status: ${WIN_64}"
has_success=false
all_skipped=true
for val in ${LINUX_64} ${LINUX_64_CUDA_129} ${LINUX_64_CUDA_130} ${OSX} ${WIN_64}; do
if [[ "${val}" == "Succeeded" ]]; then
has_success=true
fi
if [[ "${val}" != "Skipped" ]]; then
all_skipped=false
fi
done
echo "any successful builds: ${has_success}"
echo "all builds skipped: ${all_skipped}"
if [[ ("${has_success}" == "true") || ("${all_skipped}" == "true") ]]; then
exit 0
else
exit 1
fi
displayName: check