libchromiumcontent/vsts.yml

135 строки
5.9 KiB
YAML

resources:
- repo: self
phases:
- phase: Build_libchromiumcontent
condition: or(eq(variables['System.PullRequest.IsFork'], 'True'), ne(variables['Build.Reason'], 'PullRequest'))
queue:
timeoutInMinutes: 180
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
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
condition: always()
- phase: Skip_libchromiumcontent_PR_build
condition: and(eq(variables['System.PullRequest.IsFork'], 'False'), eq(variables['Build.Reason'], 'PullRequest'))
steps:
- bash: |
echo "Skipping PR build for PR requested from branch."
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
condition: always()