这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
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
136 changes: 21 additions & 115 deletions azure-pipelines-CI.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# azure-pipelines-CI.yml
parameters:
- name: SkipTests
displayName: Skip Tests
Expand All @@ -23,20 +24,13 @@ resources:

variables:
- template: /eng/common/templates/variables/pool-providers.yml@self
- name: _TeamName
value: DotNetTry
- name: _BuildConfig
value: Release
- name: _PublishUsingPipelines
value: true
- name: _DotNetArtifactsCategory
value: .NETCore
- name: DotNetSdkVersion
value: '8.0.204'
- name: NodeJSVersion
value: '16.13.0'
- name: Codeql.Enabled
value: true
- template: /eng/templates/variables-template.yml
parameters:
buildConfig: 'Release'
- name: additionalWindowsArgs
value: ''
- name: additionalLinuxArgs
value: ''

extends:
# The pipeline extends the 1ES PT which will inject different SDL and compliance tasks.
Expand Down Expand Up @@ -123,59 +117,13 @@ extends:
- name: _BuildArgs
value: /p:SignType=$(_SignType)
steps:
- script: git config --global core.longpaths true
displayName: Enable `git clean` to handle long paths

- checkout: self
clean: true

- task: NodeTool@0
displayName: Add NodeJS/npm
inputs:
versionSpec: $(NodeJSVersion)

- task: UseDotNet@2
displayName: Add dotnet
inputs:
packageType: sdk
version: $(DotNetSdkVersion)
installationPath: $(Agent.ToolsDirectory)\dotnet

- script: |
robocopy "eng\resources" "$(Build.SourcesDirectory)\artifacts"
:: robocopy return codes are terrible; 1 means files were copied
if "%errorlevel%" == "1" exit /b 0
exit /b 1
displayName: Prevent test directory crawling

- pwsh: |
$testArg = if ($env:SKIPTESTS -ne "true") { "-test" } else { "" }
Write-Host "##vso[task.setvariable variable=_TestArgs]$testArg"
displayName: Promote variables

- script: eng\CIBuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
-sign
$(_BuildArgs)
$(_TestArgs)
displayName: Build
env:
POCKETLOGGER_LOG_PATH: $(PocketLoggerLogPath)
TRYDOTNET_PREBUILDS_PATH: $(TryDotNetPrebuildsPath)

- script: dotnet test -l trx --no-build --blame-hang-timeout 15m --blame-hang-dump-type full -c $(_BuildConfig) --results-directory $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)
displayName: Test / Blame
workingDirectory: $(Build.SourcesDirectory)
condition: ne(variables['SkipTests'], 'true')
env:
RunIntegrationTests: $(RunIntegrationTests)

- pwsh: Get-ChildItem *.dmp -Recurse | Remove-Item
displayName: Delete dump files
workingDirectory: $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)
condition: and(ne(variables['KeepDumps'], 'true'), ne(variables['SkipTests'], 'true'))

- template: /eng/templates/build-and-test-job-windows-templates.yml
parameters:
buildConfig: $(_BuildConfig)
skipTests: $(SkipTests)
buildArgs: $(_BuildArgs)
additionalArgs: $(additionalWindowsArgs)
publishArtifacts: false

- template: /eng/common/templates-official/jobs/jobs.yml@self
parameters:
Expand Down Expand Up @@ -221,54 +169,12 @@ extends:
- name: _BuildArgs
value: /p:SignType=$(_SignType)
steps:
- script: git config --global core.longpaths true
displayName: Enable `git clean` to handle long paths

- checkout: self
clean: true

- task: NodeTool@0
displayName: Add NodeJS/npm
inputs:
versionSpec: $(NodeJSVersion)

- task: UseDotNet@2
displayName: Add dotnet
inputs:
packageType: sdk
version: $(DotNetSdkVersion)
installationPath: $(Agent.ToolsDirectory)/dotnet

- script: |
mkdir -p "$(Build.SourcesDirectory)/artifacts"
cp eng/resources/* "$(Build.SourcesDirectory)/artifacts"
displayName: Prevent test directory crawling

- pwsh: |
$testArg = if ($env:SKIPTESTS -ne "true") { "--test" } else { "" }
Write-Host "##vso[task.setvariable variable=_TestArgs]$testArg"
displayName: Promote variables

- script: ./eng/cibuild.sh
--configuration $(_BuildConfig)
--prepareMachine
$(_TestArgs)
displayName: Build
env:
POCKETLOGGER_LOG_PATH: $(PocketLoggerLogPath)
TRYDOTNET_PREBUILDS_PATH: $(TryDotNetPrebuildsPath)

- script: dotnet test -l trx --no-build --blame-hang-timeout 15m --blame-hang-dump-type full -c $(_BuildConfig) --results-directory $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)
displayName: Test / Blame
workingDirectory: $(Build.SourcesDirectory)
condition: ne(variables['SkipTests'], 'true')
env:
RunIntegrationTests: $(RunIntegrationTests)

- pwsh: Get-ChildItem *.dmp -Recurse | Remove-Item
displayName: Delete dump files
workingDirectory: $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)
condition: and(ne(variables['KeepDumps'], 'true'), ne(variables['SkipTests'], 'true'))
- template: /eng/templates/build-and-test-job-linux-templates.yml
parameters:
buildConfig: $(_BuildConfig)
skipTests: $(SkipTests)
additionalArgs: $(additionalLinuxArgs)
publishArtifacts: false

#---------------------------------------------------------------------------------------------------------------------#
# Post Build #
Expand Down
151 changes: 21 additions & 130 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# azure-pipelines.yml
parameters:
- name: SkipTests
displayName: Skip Tests
Expand All @@ -15,22 +16,15 @@ pr:
- release/*

variables:
- name: _TeamName
value: DotNetTry
- name: _BuildConfig
value: Debug
- name: _PublishUsingPipelines
value: true
- name: _DotNetArtifactsCategory
value: .NETCore
- name: DotNetSdkVersion
value: '8.0.204'
- name: NodeJSVersion
value: '16.13.0'
- name: Codeql.Enabled
value: true
- template: /eng/templates/variables-template.yml
parameters:
buildConfig: 'Debug'
- name: system.debug
value: true
- name: additionalWindowsArgs
value: '--diag $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/diag.txt -p:m=1'
- name: additionalLinuxArgs
value: '--diag $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/diag.txt'

stages:
- stage: build
Expand Down Expand Up @@ -88,66 +82,13 @@ stages:
- name: _BuildArgs
value: /p:SignType=$(_SignType)
steps:
- script: git config --global core.longpaths true
displayName: Enable `git clean` to handle long paths

- checkout: self
clean: true

- task: NodeTool@0
displayName: Add NodeJS/npm
inputs:
versionSpec: $(NodeJSVersion)

- task: UseDotNet@2
displayName: Add dotnet
inputs:
packageType: sdk
version: $(DotNetSdkVersion)
installationPath: $(Agent.ToolsDirectory)\dotnet

- script: |
robocopy "eng\resources" "$(Build.SourcesDirectory)\artifacts"
:: robocopy return codes are terrible; 1 means files were copied
if "%errorlevel%" == "1" exit /b 0
exit /b 1
displayName: Prevent test directory crawling

- pwsh: |
$testArg = if ($env:SKIPTESTS -ne "true") { "-test" } else { "" }
Write-Host "##vso[task.setvariable variable=_TestArgs]$testArg"
displayName: Promote variables

- script: eng\CIBuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
-sign
$(_BuildArgs)
$(_TestArgs)
displayName: Build
env:
POCKETLOGGER_LOG_PATH: $(PocketLoggerLogPath)
TRYDOTNET_PREBUILDS_PATH: $(TryDotNetPrebuildsPath)

- script: dotnet test -l trx --no-build --blame-hang-timeout 15m --blame-hang-dump-type full -c $(_BuildConfig) --results-directory $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig) --diag $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/diag.txt -p:m=1
displayName: Test / Blame
workingDirectory: $(Build.SourcesDirectory)
condition: ne(variables['SkipTests'], 'true')
env:
RunIntegrationTests: $(RunIntegrationTests)

- pwsh: Get-ChildItem *.dmp -Recurse | Remove-Item
displayName: Delete dump files
workingDirectory: $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)
condition: and(ne(variables['KeepDumps'], 'true'), ne(variables['SkipTests'], 'true'))

- task: PublishBuildArtifacts@1
displayName: Publish Windows artifacts
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/
artifactName: Windows_artifacts
artifactType: container
condition: always()
- template: /eng/templates/build-and-test-job-windows-templates.yml
parameters:
buildConfig: $(_BuildConfig)
skipTests: $(SkipTests)
buildArgs: $(_BuildArgs)
additionalArgs: $(additionalWindowsArgs)
publishArtifacts: true

- template: /eng/common/templates/jobs/jobs.yml
parameters:
Expand Down Expand Up @@ -182,62 +123,12 @@ stages:
- name: _BuildArgs
value: /p:SignType=$(_SignType)
steps:
- script: git config --global core.longpaths true
displayName: Enable `git clean` to handle long paths

- checkout: self
clean: true

- task: NodeTool@0
displayName: Add NodeJS/npm
inputs:
versionSpec: $(NodeJSVersion)

- task: UseDotNet@2
displayName: Add dotnet
inputs:
packageType: sdk
version: $(DotNetSdkVersion)
installationPath: $(Agent.ToolsDirectory)/dotnet

- script: |
mkdir -p "$(Build.SourcesDirectory)/artifacts"
cp eng/resources/* "$(Build.SourcesDirectory)/artifacts"
displayName: Prevent test directory crawling

- pwsh: |
$testArg = if ($env:SKIPTESTS -ne "true") { "--test" } else { "" }
Write-Host "##vso[task.setvariable variable=_TestArgs]$testArg"
displayName: Promote variables

- script: ./eng/cibuild.sh
--configuration $(_BuildConfig)
--prepareMachine
$(_TestArgs)
displayName: Build
env:
POCKETLOGGER_LOG_PATH: $(PocketLoggerLogPath)
TRYDOTNET_PREBUILDS_PATH: $(TryDotNetPrebuildsPath)

- script: dotnet test -l trx --no-build --blame-hang-timeout 15m --blame-hang-dump-type full -c $(_BuildConfig) --results-directory $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig) --diag $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/diag.txt
displayName: Test / Blame
workingDirectory: $(Build.SourcesDirectory)
condition: ne(variables['SkipTests'], 'true')
env:
RunIntegrationTests: $(RunIntegrationTests)

- pwsh: Get-ChildItem *.dmp -Recurse | Remove-Item
displayName: Delete dump files
workingDirectory: $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)
condition: and(ne(variables['KeepDumps'], 'true'), ne(variables['SkipTests'], 'true'))

- task: PublishBuildArtifacts@1
displayName: Publish Linux artifacts
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/
artifactName: Linux_artifacts
artifactType: container
condition: always()
- template: /eng/templates/build-and-test-job-linux-templates.yml
parameters:
buildConfig: $(_BuildConfig)
skipTests: $(SkipTests)
additionalArgs: $(additionalLinuxArgs)
publishArtifacts: true

#---------------------------------------------------------------------------------------------------------------------#
# Post Build #
Expand Down
50 changes: 50 additions & 0 deletions eng/templates/build-and-test-job-linux-templates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# build-and-test-job-linux-template.yml
parameters:
buildConfig: 'Release'
buildArgs: ''
skipTests: false
publishArtifacts: false
enableDiagnosticsAndParallelism: false
additionalArgs: '' # Additional arguments to pass to the test command
steps:
- template: setup-template.yml

- script: |
mkdir -p "$(Build.SourcesDirectory)/artifacts"
cp eng/resources/* "$(Build.SourcesDirectory)/artifacts"
displayName: Prevent test directory crawling

- pwsh: |
$testArg = if ($env:SKIPTESTS -ne "true") { "--test" } else { "" }
Write-Host "##vso[task.setvariable variable=_TestArgs]$testArg"
displayName: Promote variables

- script: ./eng/cibuild.sh
--configuration ${{ parameters.buildConfig }}
--prepareMachine
$(_TestArgs)
displayName: Build
env:
POCKETLOGGER_LOG_PATH: $(PocketLoggerLogPath)
TRYDOTNET_PREBUILDS_PATH: $(TryDotNetPrebuildsPath)

- script: |
dotnet test -l trx --no-build --blame-hang-timeout 15m --blame-hang-dump-type full -c ${{ parameters.buildConfig }} --results-directory $(Build.SourcesDirectory)/artifacts/TestResults/${{ parameters.buildConfig }} ${{ parameters.additionalArgs }}
displayName: Test / Blame
workingDirectory: $(Build.SourcesDirectory)
condition: ne('${{ parameters.skipTests }}', 'true')
env:
RunIntegrationTests: $(RunIntegrationTests)

- pwsh: Get-ChildItem *.dmp -Recurse | Remove-Item
displayName: Delete dump files
workingDirectory: $(Build.SourcesDirectory)/artifacts/TestResults/${{ parameters.buildConfig }}
condition: and(ne(variables['KeepDumps'], 'true'), ne('${{ parameters.skipTests }}', 'true'))

- task: PublishBuildArtifacts@1
displayName: Publish Linux artifacts
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/
artifactName: Linux_artifacts
artifactType: container
condition: ${{ parameters.publishArtifacts }}
Loading