Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/9.0] [ci] Don't run tests on internal pipeline builds #6467

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
Loading