Skip to content

Commit

Permalink
Enable UT in only PR triggering in CI pipeline, to decrease running t…
Browse files Browse the repository at this point in the history
…ime #316
  • Loading branch information
olivershen-wow authored Mar 2, 2023
1 parent 8cb22e2 commit c7d4b52
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions azure-pipelines-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ stages:
script: |
New-Item -Path common/src/test/resources -Name ".env" -ItemType "file" -Value "BLOB_CONNECTION_STRING = $(BLOB_CONNECTION_STRING)"
workingDirectory: '$(Build.Repository.LocalPath)'
condition: eq(variables.fullBuild, 'false')
- task: PowerShell@2
displayName: Set center/agent version
inputs:
Expand All @@ -58,7 +59,7 @@ stages:
(Get-Content center/src/main/resources/version.properties) -Replace '1000000', "$hydraVersionCode"| Set-Content center/src/main/resources/version.properties
(Get-Content center/src/main/resources/version.properties) -Replace '0.0.0', $hydraVersion| Set-Content center/src/main/resources/version.properties
workingDirectory: '$(Build.Repository.LocalPath)'
condition: and(succeeded(), eq(variables.fullBuild, 'true'), contains(variables['Build.SourceBranch'], 'Release/'))
condition: and(eq(variables.fullBuild, 'true'), contains(variables['Build.SourceBranch'], 'Release/'))
- task: Gradle@3
displayName: Run JUnit Test
inputs:
Expand All @@ -72,19 +73,22 @@ stages:
jdkVersionOption: '1.11'
sonarQubeRunAnalysis: false
spotBugsAnalysis: false
condition: eq(variables.fullBuild, 'false')
- task: PowerShell@2
displayName: Delete Env File
inputs:
targetType: 'inline'
script: |
Remove-Item -Path common/src/test/resources/.env -Force
workingDirectory: '$(Build.Repository.LocalPath)'
condition: eq(variables.fullBuild, 'false')
- task: PublishCodeCoverageResults@1
displayName: Publich Code Coverage
inputs:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: 'build/reports/jacoco/jacocoRootReport/*.xml'
reportDirectory: 'build/reports/jacoco/jacocoRootReport/html'
condition: eq(variables.fullBuild, 'false')
- task: Gradle@2
displayName: Build center
inputs:
Expand All @@ -111,21 +115,21 @@ stages:
SourceFolder: 'center/'
Contents: 'Dockerfile'
TargetFolder: '$(Build.ArtifactStagingDirectory)/center_deploy'
condition: and(succeeded(), eq(variables.fullBuild, 'true'))
condition: eq(variables.fullBuild, 'true')
- task: CopyFiles@2
displayName: Copy deploy center files 2
inputs:
SourceFolder: 'center/deploy_startup/'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)/center_deploy/deploy_startup'
condition: and(succeeded(), eq(variables.fullBuild, 'true'))
condition: eq(variables.fullBuild, 'true')
- task: CopyFiles@2
displayName: Copy center jar
inputs:
SourceFolder: 'center/build/libs/'
Contents: '*.jar'
TargetFolder: '$(Build.ArtifactStagingDirectory)/center_deploy'
condition: and(succeeded(), eq(variables.fullBuild, 'true'))
condition: eq(variables.fullBuild, 'true')
- task: Gradle@2
displayName: Package Mac installer
inputs:
Expand All @@ -136,7 +140,7 @@ stages:
jdkVersionOption: '1.11'
sonarQubeRunAnalysis: false
spotBugsAnalysis: false
condition: and(succeeded(), eq(variables.fullBuild, 'true'))
condition: eq(variables.fullBuild, 'true')
- task: Gradle@2
displayName: Package Windows installer
inputs:
Expand All @@ -147,39 +151,39 @@ stages:
jdkVersionOption: '1.11'
sonarQubeRunAnalysis: false
spotBugsAnalysis: false
condition: and(succeeded(), eq(variables.fullBuild, 'true'))
condition: eq(variables.fullBuild, 'true')
- task: CopyFiles@2
displayName: Copy agent jar
inputs:
SourceFolder: 'agent/build/libs/'
Contents: '*.jar'
TargetFolder: '$(Build.ArtifactStagingDirectory)/agent_deploy'
condition: and(succeeded(), eq(variables.fullBuild, 'true'))
condition: eq(variables.fullBuild, 'true')
- task: CopyFiles@2
displayName: Copy agent installer
inputs:
SourceFolder: 'build/installer/'
Contents: '*.zip'
TargetFolder: '$(Build.ArtifactStagingDirectory)/agent_deploy'
condition: and(succeeded(), eq(variables.fullBuild, 'true'))
condition: eq(variables.fullBuild, 'true')
- task: CopyFiles@2
displayName: Copy deploy uber files
inputs:
SourceFolder: 'center/uber_image/'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)/uber_image'
condition: and(succeeded(), eq(variables.fullBuild, 'true'))
condition: eq(variables.fullBuild, 'true')
- task: PowerShell@2
displayName: Add Release Tag
inputs:
targetType: 'inline'
script: |
Write-Host "##vso[build.addbuildtag]Release"
workingDirectory: '$(Build.Repository.LocalPath)'
condition: and(succeeded(), eq(variables.fullBuild, 'true'), contains(variables['Build.SourceBranch'], 'Release/'))
condition: and(eq(variables.fullBuild, 'true'), contains(variables['Build.SourceBranch'], 'Release/'))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'HydraLabRelease'
publishLocation: 'Container'
condition: and(succeeded(), eq(variables.fullBuild, 'true'))
condition: eq(variables.fullBuild, 'true')

0 comments on commit c7d4b52

Please sign in to comment.