Skip to content

Commit f3a410d

Browse files
authored
[ci] Don't run tests on internal pipeline builds (#6413)
1 parent 0b562b8 commit f3a410d

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

eng/pipelines/templates/BuildAndTest.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@ parameters:
2121
default: false
2222

2323
steps:
24-
# Internal pipeline: Build with pack+sign+archive
24+
# Internal pipeline: Build with pack+sign
2525
- ${{ if ne(parameters.runAsPublic, 'true') }}:
2626
- script: ${{ parameters.buildScript }}
2727
-restore -build
2828
-pack
2929
-sign $(_SignArgs)
3030
-publish $(_PublishArgs)
3131
-configuration ${{ parameters.buildConfig }}
32-
/p:ArchiveTests=true
3332
/bl:${{ parameters.repoLogPath }}/build.binlog
3433
$(_OfficialBuildIdArgs)
3534
$(_InternalBuildArgs)
@@ -46,7 +45,9 @@ steps:
4645
$(_OfficialBuildIdArgs)
4746
displayName: Build
4847

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

7475
displayName: Run non-helix tests
7576

76-
- ${{ if or(ne(parameters.runAsPublic, 'true'), eq(parameters.runHelixTests, 'true')) }}:
77+
# Helix tests are run only on the public pipeline
78+
- ${{ if and(eq(parameters.runAsPublic, 'true'), eq(parameters.runHelixTests, 'true')) }}:
7779
- script: ${{ parameters.buildScript }}
7880
/p:Configuration=${{ parameters.buildConfig }}
7981
$(_OfficialBuildIdArgs)
@@ -117,24 +119,18 @@ steps:
117119
continueOnError: true
118120
condition: always()
119121

120-
- task: CopyFiles@2
121-
inputs:
122-
Contents: '${{ parameters.repoArtifactsPath }}/**/*.cobertura.xml'
123-
TargetFolder: '${{ parameters.repoArtifactsPath }}/CodeCoverage'
124-
flattenFolders: true
125-
displayName: Gather code coverage results
126-
122+
# Code coverage - only on public pipelines
127123
- ${{ if eq(parameters.runAsPublic, 'true') }}:
124+
- task: CopyFiles@2
125+
inputs:
126+
Contents: '${{ parameters.repoArtifactsPath }}/**/*.cobertura.xml'
127+
TargetFolder: '${{ parameters.repoArtifactsPath }}/CodeCoverage'
128+
flattenFolders: true
129+
displayName: Gather code coverage results
130+
128131
- task: PublishPipelineArtifact@1
129132
displayName: Publish coverage results (cobertura.xml)
130133
inputs:
131134
targetPath: '${{ parameters.repoArtifactsPath }}/CodeCoverage'
132135
artifactName: '$(Agent.JobName)_CodeCoverageResults'
133136
publishLocation: 'pipeline'
134-
135-
- ${{ if ne(parameters.runAsPublic, 'true') }}:
136-
- task: 1ES.PublishPipelineArtifact@1
137-
displayName: Publish code coverage results
138-
inputs:
139-
targetPath: '${{ parameters.repoArtifactsPath }}/CodeCoverage'
140-
artifactName: '$(Agent.JobName)_CodeCoverageResults'

0 commit comments

Comments
 (0)