forked from microsoft/STL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckout-sources.yml
100 lines (90 loc) · 3.08 KB
/
checkout-sources.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
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
parameters:
- name: llvmSHAVar
type: string
default: llvmSHA
- name: boostMathSHAVar
type: string
default: boostMathSHA
- name: googleBenchmarkSHAVar
type: string
default: googleBenchmarkSHA
steps:
- checkout: self
clean: true
submodules: false
- script: |
cd $(Build.SourcesDirectory)
git clean --quiet -x -d -f -f
displayName: 'Clean after checkout'
- task: PowerShell@2
displayName: 'Get submodule SHAs'
timeoutInMinutes: 1
inputs:
targetType: inline
script: |
cd $(Build.SourcesDirectory)
$regexSubmoduleSHA = '^[ \-+]([0-9a-f]+) .*$'
$llvmSHA = git submodule status --cached llvm-project | %{$_ -replace $regexSubmoduleSHA, '$1'}
Write-Host "##vso[task.setvariable variable=${{ parameters.llvmSHAVar }};]$llvmSHA"
$boostMathSHA = git submodule status --cached boost-math | %{$_ -replace $regexSubmoduleSHA, '$1'}
Write-Host "##vso[task.setvariable variable=${{ parameters.boostMathSHAVar }};]$boostMathSHA"
$googleBenchmarkSHA = git submodule status --cached benchmarks/google-benchmark `
| %{$_ -replace $regexSubmoduleSHA, '$1'}
Write-Host "##vso[task.setvariable variable=${{ parameters.googleBenchmarkSHAVar }};]$googleBenchmarkSHA"
- script: |
cd $(Build.SourcesDirectory)
if not exist "llvm-project" (
mkdir llvm-project
)
cd llvm-project
if not exist ".git" (
del /S /Q *
git init
)
git remote get-url llvm
if errorlevel 1 (
git remote add llvm https://github.com/llvm/llvm-project.git
)
git fetch --filter=tree:0 --depth=1 llvm $(${{ parameters.llvmSHAVar }})
git sparse-checkout set --cone --sparse-index libcxx/test libcxx/utils/libcxx llvm/utils/lit
git reset --quiet --hard FETCH_HEAD
git clean --quiet -x -d -f -f
displayName: "Checkout LLVM source"
- script: |
cd $(Build.SourcesDirectory)
if not exist "boost-math" (
mkdir boost-math
)
cd boost-math
if not exist ".git" (
del /S /Q *
git init
)
git remote get-url boostorg
if errorlevel 1 (
git remote add boostorg https://github.com/boostorg/math.git
)
git fetch --filter=tree:0 --depth=1 boostorg $(${{ parameters.boostMathSHAVar }})
git reset --quiet --hard FETCH_HEAD
git clean --quiet -x -d -f -f
displayName: "Checkout boost-math source"
- script: |
cd $(Build.SourcesDirectory)/benchmarks
if not exist "google-benchmark" (
mkdir google-benchmark
)
cd google-benchmark
if not exist ".git" (
del /S /Q *
git init
)
git remote get-url googlebenchmark
if errorlevel 1 (
git remote add googlebenchmark https://github.com/google/benchmark.git
)
git fetch --filter=tree:0 --depth=1 googlebenchmark $(${{ parameters.googleBenchmarkSHAVar }})
git reset --quiet --hard FETCH_HEAD
git clean --quiet -x -d -f -f
displayName: "Checkout google benchmark source"