make sure tests don't run for GitHub releases. (#13701)

Also fix VSTS slack integration and
Update to latest libchromiumcontent

(cherry picked from commit 1c70a1cccd)
This commit is contained in:
John Kleinschmidt 2018-07-17 11:57:59 -04:00 committed by Charles Kerr
parent 8f8d198c5a
commit 9237d46dba
3 changed files with 34 additions and 38 deletions

View file

@ -81,9 +81,13 @@ build-steps: &build-steps
mkdir junit mkdir junit
script/test.py --ci --rebuild_native_modules script/test.py --ci --rebuild_native_modules
else else
echo 'Testing Electron release build' if [ "$UPLOAD_TO_S3" == "1" ]; then
mkdir junit echo 'Testing Electron release build'
script/test.py --ci --rebuild_native_modules -c R mkdir junit
script/test.py --ci --rebuild_native_modules -c R
else
echo 'Skipping tests on GitHub release'
fi
fi fi
else else
echo 'Skipping tests due to configuration' echo 'Skipping tests due to configuration'
@ -118,10 +122,7 @@ build-steps: &build-steps
- store_artifacts: - store_artifacts:
path: junit path: junit
- store_artifacts: - store_artifacts:
path: out/electron.d.ts path: out
- store_artifacts:
path: out/electron-api.json
build-defaults: &build-defaults build-defaults: &build-defaults
docker: docker:

View file

@ -1,25 +1,22 @@
version: 1.0.{build} version: 1.0.{build}
branches:
except:
- /^release$|^release-\d-\d-x$/
build_cloud: electron-16 build_cloud: electron-16
image: electron-16-vs2017 image: electron-16-vs2017
environment: environment:
DISABLE_CRASH_REPORTER_TESTS: true DISABLE_CRASH_REPORTER_TESTS: true
matrix:
- TARGET_ARCH: ia32
- TARGET_ARCH: x64
build_script: build_script:
- ps: >- - ps: >-
if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) { if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
} else { } else {
Add-Path "$env:ProgramFiles (x86)\Windows Kits\10\Debuggers\x64" Add-Path "$env:ProgramFiles (x86)\Windows Kits\10\Debuggers\x64"
$env:path = "$env:ProgramFiles (x86)\Windows Kits\10\Debuggers\x64;$env:path" $env:path = "$env:ProgramFiles (x86)\Windows Kits\10\Debuggers\x64;$env:path"
if($env:APPVEYOR_SCHEDULED_BUILD -eq 'True') { if($env:APPVEYOR_SCHEDULED_BUILD -eq 'True') {
$env:RUN_RELEASE_BUILD = "1" $env:RUN_RELEASE_BUILD = "1"
} }
$Message = (git log --format=%B -n 1 HEAD) | Out-String $Message = (git log --format=%B -n 1 HEAD) | Out-String
if ((Test-Path Env:\RUN_RELEASE_BUILD)) { if ((Test-Path Env:\RUN_RELEASE_BUILD)) {
$env:ELECTRON_RELEASE = '1' $env:ELECTRON_RELEASE = '1'
Write-Output "release build triggered from api" Write-Output "release build triggered from api"
@ -39,8 +36,8 @@ build_script:
} else { } else {
"Build succeeded." "Build succeeded."
} }
Push-AppveyorArtifact out
} }
test_script: test_script:
- ps: >- - ps: >-
if (Test-Path Env:\ELECTRON_RELEASE) { if (Test-Path Env:\ELECTRON_RELEASE) {
@ -54,7 +51,6 @@ test_script:
Write-Output "Tests succeeded." Write-Output "Tests succeeded."
} }
python script\verify-ffmpeg.py python script\verify-ffmpeg.py
if ($LASTEXITCODE -ne '0') { if ($LASTEXITCODE -ne '0') {
throw "Verify ffmpeg failed with exit code $LASTEXITCODE" throw "Verify ffmpeg failed with exit code $LASTEXITCODE"
} else { } else {
@ -73,22 +69,5 @@ deploy_script:
} else { } else {
Write-Output "Uploading Electron release distribution to github releases" Write-Output "Uploading Electron release distribution to github releases"
& python script\upload.py & python script\upload.py
if (Test-Path Env:\AUTO_RELEASE) {
node script\release.js --validateRelease --automaticRelease
if ($? -eq 'True') {
echo 'Release is ready to go; now running release'
node script\release.js --automaticRelease
if ($? -eq 'True') {
echo 'Release successful, now publishing to npm'
$npmfile = "$HOME\.npmrc"
"//registry.npmjs.org/:_authToken=$env:ELECTRON_NPM_TOKEN" > $npmfile
npm run publish-to-npm
}
} else {
echo 'Release is not complete, skipping publish for now.'
}
}
} }
} else {
Write-Output "Skipping upload distribution because build is not for release"
} }

View file

@ -54,6 +54,7 @@ steps:
script/test.py --ci --rebuild_native_modules script/test.py --ci --rebuild_native_modules
fi fi
name: Test name: Test
condition: or(ne(variables['ELECTRON_RELEASE'], '1'), eq(variables['UPLOAD_TO_S3'], '1'))
- bash: | - bash: |
echo 'Verifying ffmpeg on build' echo 'Verifying ffmpeg on build'
@ -63,6 +64,7 @@ steps:
script/verify-ffmpeg.py script/verify-ffmpeg.py
fi fi
name: Verify_FFmpeg name: Verify_FFmpeg
condition: or(ne(variables['ELECTRON_RELEASE'], '1'), eq(variables['UPLOAD_TO_S3'], '1'))
- task: PublishTestResults@2 - task: PublishTestResults@2
displayName: Publish Test Results displayName: Publish Test Results
@ -71,12 +73,26 @@ steps:
searchFolder: junit searchFolder: junit
condition: and(always(), ne(variables['ELECTRON_RELEASE'], '1')) condition: and(always(), ne(variables['ELECTRON_RELEASE'], '1'))
- task: kasunkodagoda.slack-notification.slack-notification-task.SlackNotification@3 - bash: |
displayName: Post Slack Notification export BUILD_URL="${SYSTEM_TEAMFOUNDATIONCOLLECTIONURI}${SYSTEM_TEAMPROJECT}/_build/results?buildId=${BUILD_BUILDID}"
export MESSAGE="Build failed for *<$BUILD_URL|$BUILD_DEFINITIONNAME>* nightly build."
curl -g -H "Content-Type: application/json" -X POST \
-d "{\"text\": \"$MESSAGE\", \"attachments\": [{\"color\": \"#FC5C3C\",\"title\": \"$BUILD_DEFINITIONNAME nightly build results\",\"title_link\": \"$BUILD_URL\"}]}" $(slack_webhook)
name: Post_Slack_Notification_on_Failure
condition: failed()
- bash: |
export BUILD_URL="${SYSTEM_TEAMFOUNDATIONCOLLECTIONURI}${SYSTEM_TEAMPROJECT}/_build/results?buildId=${BUILD_BUILDID}"
export MESSAGE="Build succeeded for *<$BUILD_URL|$BUILD_DEFINITIONNAME>* nightly build."
curl -g -H "Content-Type: application/json" -X POST \
-d "{\"text\": \"$MESSAGE\", \"attachments\": [{\"color\": \"#FC5C3C\",\"title\": \"$BUILD_DEFINITIONNAME nightly build results\",\"title_link\": \"$BUILD_URL\"}]}" $(slack_webhook)
name: Post_Slack_Notification_on_Success
condition: succeeded()
- task: PublishBuildArtifacts@1
displayName: Publish Build Artifacts
inputs: inputs:
SlackApiToken: '$(slack_token)' PathtoPublish: '$(Build.SourcesDirectory)/out'
Channel: '#bot-nightly-releases' ArtifactName: out
Message: '$(Build.DefinitionName)-$(Build.BuildNumber) finished with a $(Agent.JobStatus) status.'
condition: and(always(), eq(variables['Build.Reason'], 'Schedule'))
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3