Skip to content

Commit

Permalink
[ci] Don't run tests on internal pipeline builds (#6467)
Browse files Browse the repository at this point in the history
Co-authored-by: Ankit Jain <[email protected]>
  • Loading branch information
github-actions[bot] and radical authored Oct 24, 2024
1 parent c51defd commit 8f0bda6
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions eng/pipelines/templates/BuildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ parameters:
default: false

steps:
# Internal pipeline: Build with pack+sign+archive
# Internal pipeline: Build with pack+sign
- ${{ if ne(parameters.runAsPublic, 'true') }}:
- script: ${{ parameters.buildScript }}
-restore -build
-pack
-sign $(_SignArgs)
-publish $(_PublishArgs)
-configuration ${{ parameters.buildConfig }}
/p:ArchiveTests=true
/bl:${{ parameters.repoLogPath }}/build.binlog
$(_OfficialBuildIdArgs)
$(_InternalBuildArgs)
Expand All @@ -46,7 +45,9 @@ steps:
$(_OfficialBuildIdArgs)
displayName: Build

- ${{ if or(ne(parameters.runAsPublic, 'true'), ne(parameters.runHelixTests, 'true')) }}:
# Non-helix tests are run only on the public pipeline
- ${{ if and(eq(parameters.runAsPublic, 'true'), ne(parameters.runHelixTests, 'true')) }}:
# non-helix tests
- ${{ if ne(parameters.isWindows, 'true') }}:
- script: mkdir ${{ parameters.repoArtifactsPath }}/devcert-scripts &&
cd ${{ parameters.repoArtifactsPath }}/devcert-scripts &&
Expand All @@ -73,7 +74,8 @@ steps:

displayName: Run non-helix tests

- ${{ if or(ne(parameters.runAsPublic, 'true'), eq(parameters.runHelixTests, 'true')) }}:
# Helix tests are run only on the public pipeline
- ${{ if and(eq(parameters.runAsPublic, 'true'), eq(parameters.runHelixTests, 'true')) }}:
- script: ${{ parameters.buildScript }}
/p:Configuration=${{ parameters.buildConfig }}
$(_OfficialBuildIdArgs)
Expand Down Expand Up @@ -117,24 +119,18 @@ steps:
continueOnError: true
condition: always()

- task: CopyFiles@2
inputs:
Contents: '${{ parameters.repoArtifactsPath }}/**/*.cobertura.xml'
TargetFolder: '${{ parameters.repoArtifactsPath }}/CodeCoverage'
flattenFolders: true
displayName: Gather code coverage results

# Code coverage - only on public pipelines
- ${{ if eq(parameters.runAsPublic, 'true') }}:
- task: CopyFiles@2
inputs:
Contents: '${{ parameters.repoArtifactsPath }}/**/*.cobertura.xml'
TargetFolder: '${{ parameters.repoArtifactsPath }}/CodeCoverage'
flattenFolders: true
displayName: Gather code coverage results

- task: PublishPipelineArtifact@1
displayName: Publish coverage results (cobertura.xml)
inputs:
targetPath: '${{ parameters.repoArtifactsPath }}/CodeCoverage'
artifactName: '$(Agent.JobName)_CodeCoverageResults'
publishLocation: 'pipeline'

- ${{ if ne(parameters.runAsPublic, 'true') }}:
- task: 1ES.PublishPipelineArtifact@1
displayName: Publish code coverage results
inputs:
targetPath: '${{ parameters.repoArtifactsPath }}/CodeCoverage'
artifactName: '$(Agent.JobName)_CodeCoverageResults'

0 comments on commit 8f0bda6

Please sign in to comment.