forked from electron/libchromiumcontent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vsts.yml
163 lines (151 loc) · 7.15 KB
/
vsts.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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
resources:
- repo: self
phases:
- phase: Build_libchromiumcontent
condition: or(eq(variables['System.PullRequest.IsFork'], 'True'), ne(variables['Build.Reason'], 'PullRequest'))
queue:
parallel: 4
timeoutInMinutes: 180
matrix:
libchromiumcontent-mas-shared:
COMPONENT: shared_library
MAS_BUILD: 1
TARGET_ARCH: x64
TARGET_TYPE: mas
libchromiumcontent-mas-static:
COMPONENT: static_library
MAS_BUILD: 1
TARGET_ARCH: x64
TARGET_TYPE: mas
libchromiumcontent-osx-shared:
COMPONENT: shared_library
TARGET_ARCH: x64
TARGET_TYPE: osx
libchromiumcontent-osx-static:
COMPONENT: static_library
TARGET_ARCH: x64
TARGET_TYPE: osx
steps:
- bash: |
set -e
if [[ -z "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}" ]] || "${SYSTEM_PULLREQUEST_ISFORK}" == "True"; then
echo "##vso[task.setvariable variable=gitcommit]$BUILD_SOURCEVERSION"
else
tmp="${BUILD_SOURCEVERSIONMESSAGE/#Merge /}"
PR_COMMIT_ID="${tmp%% into*}"
echo "PR is for repo branch, using original commit $PR_COMMIT_ID"
echo "##vso[task.setvariable variable=gitcommit]$PR_COMMIT_ID"
echo "Checking out $PR_COMMIT_ID"
git checkout $PR_COMMIT_ID
echo "Now switched to `git rev-parse HEAD`"
fi
name: Get_commit
- bash: |
set -e
echo "===Bootstrapping===" > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
script/bootstrap > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
mkdir s3files
name: Bootstrap
- bash: |
set -e
echo "===Updating for $TARGET_ARCH===" > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
if [ "${COMPONENT}" == "shared_library" ]; then
if [ "${TARGET_TYPE}" == "osx" ]; then
# Only upload packaged source once, so use osx shared_library build to do so
echo "===Updating for $TARGET_ARCH=== uploading packaged src" > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
echo "##vso[task.setvariable variable=ChromiumVersion]`cat VERSION`"
script/update --clean -t $TARGET_ARCH --use-bundled-sccache --use_packaged_src --upload_packaged_src > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
if [ -f src.tar.bz2 ]; then
echo "Packaged source exists, setting it up for upload"
mv src.tar.bz2 s3files
echo "##vso[task.setvariable variable=UploadPackagedSrc]True"
echo "UploadPackagedSrc has value: $(UploadPackagedSrc)"
else
echo "Packaged source does NOT exist, skipping upload"
ls -la *
fi
else
script/update --clean -t $TARGET_ARCH --use-bundled-sccache --use_packaged_src > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
fi
else
script/update --clean -t $TARGET_ARCH --use_packaged_src > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
fi
name: Update
- task: AmazonWebServices.aws-vsts-tools.S3Upload.S3Upload@1
inputs:
awsCredentials: 'Libchromium Content S3'
regionName: 'us-east-1'
bucketName: 'github-janky-artifacts'
sourceFolder: s3files
globExpressions: 'src.tar.*'
targetFolder: 'libchromiumcontent/$(TARGET_TYPE)/src/$(ChromiumVersion)'
filesAcl: 'public-read'
logRequest: true
logResponse: true
condition: and(succeeded(), eq(variables['UploadPackagedSrc'], 'True'))
- bash: |
set -e
if [ "${COMPONENT}" == "shared_library" ]; then
script/sccache --start-server --azure_container "$(SCCACHE_AZURE_BLOB_CONTAINER)" --azure_connection "$(SCCACHE_AZURE_CONNECTION_STRING)" > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
script/sccache -s > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
fi
echo "===Building $COMPONENT for $TARGET_ARCH===" > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
script/build -t $TARGET_ARCH -c $COMPONENT > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
echo "===Building ffmpeg for $TARGET_ARCH===" > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
script/build -t $TARGET_ARCH -c ffmpeg > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
if [ "${COMPONENT}" == "shared_library" ]; then
script/sccache --stop-server > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
else
if [ "${BUILD_REASON}" == "Schedule" ]; then
script/build -t $TARGET_ARCH -c tests > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
fi
fi
name: Build
- bash: |
set -e
echo "===Create $COMPONENT distribution for $TARGET_ARCH===" > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
script/create-dist -t $TARGET_ARCH -c $COMPONENT > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
mv libchromiumcontent* s3files
mv buildlog.txt s3files
name: Create_distribution
- bash: |
set +e
echo "===Run tests against $COMPONENT distribution for $TARGET_ARCH===" > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
script/run_tests --generate_report > >(tee -a buildlog.txt) 2> >(tee -a buildlog.txt >&2)
cp -r test_reports s3files
name: Run_tests
condition: and(succeeded(), eq(variables['Build.Reason'], 'Schedule'), eq(variables['COMPONENT'], 'static_library'))
- task: PublishTestResults@2
inputs:
testResultsFiles: '*.xml'
searchFolder: '$(System.DefaultWorkingDirectory)/test_reports'
testRunTitle: 'Libchromiumcontent Tests'
condition: and(always(), eq(variables['Build.Reason'], 'Schedule'), eq(variables['COMPONENT'], 'static_library'))
- task: AmazonWebServices.aws-vsts-tools.S3Upload.S3Upload@1
inputs:
awsCredentials: 'Libchromium Content S3'
regionName: 'us-east-1'
bucketName: 'github-janky-artifacts'
sourceFolder: s3files
globExpressions: 'libchromiumcontent*'
targetFolder: 'libchromiumcontent/$(TARGET_TYPE)/$(TARGET_ARCH)/$(gitcommit)'
filesAcl: 'public-read'
logRequest: true
logResponse: true
- bash: |
if [[ -z "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}" ]]; then
echo "Skipping build results upload because there is not a PR number"
else
npm install --prefix ./script/reportbuild
LIBCHROMIUMCONTENT_GITHUB_TOKEN=$(LIBCHROMIUMCONTENT_GITHUB_TOKEN) node script/reportbuild/upload-build-results.js --buildName="$AGENT_JOBNAME" --logFile="$(TARGET_TYPE)/$(TARGET_ARCH)/$(gitcommit)/buildlog.txt" --prNumber="$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" --commitId="$BUILD_SOURCEVERSION" --failed
fi
condition: failed()
- bash: |
if [[ -z "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}" ]]; then
echo "Skipping build results upload because there is not a PR number"
else
npm install --prefix ./script/reportbuild
LIBCHROMIUMCONTENT_GITHUB_TOKEN=$(LIBCHROMIUMCONTENT_GITHUB_TOKEN) node script/reportbuild/upload-build-results.js --buildName="$AGENT_JOBNAME" --logFile="$(TARGET_TYPE)/$(TARGET_ARCH)/$(gitcommit)/buildlog.txt" --prNumber="$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" --commitId="$BUILD_SOURCEVERSION"
fi
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
condition: always()