New: Don't Run Unit/Integration/Analyze Back if no backend changes

pull/2/head
Qstick 5 years ago
parent daee348795
commit a39991a9ca

@ -25,9 +25,28 @@ pr:
- aphrodite - aphrodite
stages: stages:
- stage: Setup
displayName: Setup
jobs:
- job:
displayName: Build Variables
pool:
vmImage: 'ubuntu-16.04'
steps:
# Set the build name properly. The 'name' property won't recursively expand so hack here:
- bash: echo "##vso[build.updatebuildnumber]$RADARRVERSION"
displayName: Set Build Name
- bash: |
git diff origin/aphrodite...origin/fix-quick-ui-build --name-only | grep -qEv "^(src/|azure-pipelines.yml)"
echo $? > is_backend_update
cat is_backend_update
displayName: Check for Backend File Changes
- publish: is_backend_update
artifact: is_backend_update
displayName: Publish update type
- stage: Build_Backend - stage: Build_Backend
displayName: Build Backend displayName: Build Backend
dependsOn: Setup
jobs: jobs:
- job: Backend - job: Backend
strategy: strategy:
@ -45,9 +64,6 @@ stages:
pool: pool:
vmImage: $(imageName) vmImage: $(imageName)
steps: steps:
# Set the build name properly. The 'name' property won't recursively expand so hack here:
- powershell: Write-Host "##vso[build.updatebuildnumber]$($env:RADARRVERSION)"
displayName: Set Build Name
- checkout: self - checkout: self
submodules: true submodules: true
fetchDepth: 1 fetchDepth: 1
@ -87,8 +103,7 @@ stages:
- stage: Build_Frontend - stage: Build_Frontend
displayName: Frontend displayName: Frontend
dependsOn: [] dependsOn: Setup
jobs: jobs:
- job: Build - job: Build
strategy: strategy:
@ -260,10 +275,26 @@ stages:
- stage: Unit_Test - stage: Unit_Test
displayName: Unit Tests displayName: Unit Tests
dependsOn: Build_Backend dependsOn: Build_Backend
condition: succeeded()
jobs: jobs:
- job: Prepare
pool:
vmImage: 'ubuntu-16.04'
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'is_backend_update'
targetPath: '.'
- bash: echo "##vso[task.setvariable variable=backendUpdated;isOutput=true]$(cat is_backend_update)"
name: setVar
- job: Unit - job: Unit
displayName: Unit Native displayName: Unit Native
dependsOn: Prepare
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendUpdated'], '1'))
strategy: strategy:
matrix: matrix:
MacCore: MacCore:
@ -338,6 +369,8 @@ stages:
- job: Unit_Docker - job: Unit_Docker
displayName: Unit Docker displayName: Unit Docker
dependsOn: Prepare
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendUpdated'], '1'))
strategy: strategy:
matrix: matrix:
mono510: mono510:
@ -391,10 +424,25 @@ stages:
- stage: Integration - stage: Integration
displayName: Integration displayName: Integration
dependsOn: Packages dependsOn: Packages
jobs: jobs:
- job: Prepare
pool:
vmImage: 'ubuntu-16.04'
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'is_backend_update'
targetPath: '.'
- bash: echo "##vso[task.setvariable variable=backendUpdated;isOutput=true]$(cat is_backend_update)"
name: setVar
- job: Integration_Native - job: Integration_Native
displayName: Integration Native displayName: Integration Native
dependsOn: Prepare
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendUpdated'], '1'))
strategy: strategy:
matrix: matrix:
MacCore: MacCore:
@ -468,6 +516,8 @@ stages:
- job: Integration_Docker - job: Integration_Docker
displayName: Integration Docker displayName: Integration Docker
dependsOn: Prepare
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendUpdated'], '1'))
strategy: strategy:
matrix: matrix:
mono510: mono510:
@ -623,11 +673,24 @@ stages:
displayName: Publish Test Results displayName: Publish Test Results
- stage: Analyze - stage: Analyze
dependsOn: [] dependsOn:
- Setup
displayName: Analyze displayName: Analyze
jobs: jobs:
- job: Prepare
pool:
vmImage: 'ubuntu-16.04'
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'is_backend_update'
targetPath: '.'
- bash: echo "##vso[task.setvariable variable=backendUpdated;isOutput=true]$(cat is_backend_update)"
name: setVar
- job: Lint_Frontend - job: Lint_Frontend
displayName: Lint Frontend displayName: Lint Frontend
strategy: strategy:
@ -676,10 +739,15 @@ stages:
- job: Analyze_Backend - job: Analyze_Backend
displayName: Backend displayName: Backend
pool: dependsOn: Prepare
vmImage: windows-2019 condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendUpdated'], '1'))
variables: variables:
disable.coverage.autogenerate: 'true' disable.coverage.autogenerate: 'true'
pool:
vmImage: windows-2019
steps: steps:
- task: UseDotNet@2 - task: UseDotNet@2
displayName: 'Install .net core' displayName: 'Install .net core'

Loading…
Cancel
Save