message: ci: optimize PR runs
diff: @@ -38,26 +38,26 @@ jobs:
  - job: bazel
  dependsOn: ["format"]
  # For master builds, continue even if format fails
  - condition: or(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
  + condition: and(not(canceled()), or(succeeded(), ne(variables['Build.Reason'], 'PullRequest')))
  strategy:
  maxParallel: 3
  matrix:
  - release:
  - CI_TARGET: 'bazel.release'
  + gcc:
  + CI_TARGET: 'bazel.gcc'
  + clang_tidy:
  + CI_TARGET: 'bazel.clang_tidy'
  asan:
  CI_TARGET: 'bazel.asan'
  tsan:
  CI_TARGET: 'bazel.tsan'
  - clang_tidy:
  - CI_TARGET: 'bazel.clang_tidy'
  - gcc:
  - CI_TARGET: 'bazel.gcc'
  compile_time_options:
  CI_TARGET: 'bazel.compile_time_options'
  # This will run on every commit/PR and will make sure the corpus generated by the fuzzers as well as fixed crashes
  # (on Fuzzit) is not crashing envoy. This will help find bugs BEFORE merging and not after.
  fuzzit:
  CI_TARGET: 'bazel.fuzzit'
  + release:
  + CI_TARGET: 'bazel.release'
  timeoutInMinutes: 360
  pool:
  vmImage: 'Ubuntu 16.04'
  @@ -111,6 +111,17 @@ jobs:
  artifactName: $(CI_TARGET)
  condition: always()
  + # https://stackoverflow.com/questions/57466218/is-an-azure-devops-build-pipeline-is-there-a-way-to-cancel-one-pipeline-job-fro
  + - powershell: |
  + $url = "$($env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)$env:SYSTEM_TEAMPROJECTID/_apis/build/builds/$($env:BUILD_BUILDID)?api-version=2.0"
  + $header = @{ Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN" }
  + $body = @{ 'status'='Cancelling' } | ConvertTo-Json
  + Invoke-RestMethod -Uri $url -Method Patch -Body $body -Headers $header -ContentType application/json
  + displayName: Cancel the pipeline
  + env:
  + SYSTEM_ACCESSTOKEN: $(System.AccessToken)
  + condition: and(failed(), eq(variables['Build.Reason'], 'PullRequest'))
  +
  - job: docker
  dependsOn: ["bazel"]
  condition: and(succeeded(), eq(variables['PostSubmit'], 'true'), ne(variables['Build.Reason'], 'PullRequest'))
  