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
70 changes: 70 additions & 0 deletions .vsts-dnup-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Pipeline: https://dev.azure.com/dnceng-public/public/

trigger: none

pr:
branches:
include:
- dnup
paths:
include:
- src/Installer/dnup/
- test/dnup.Tests/
- global.json
- .vsts-dnup-tests.yml

parameters:
- name: enableArm64Job
displayName: Enables the ARM64 job
type: boolean
default: true

variables:
- template: /eng/pipelines/templates/variables/sdk-defaults.yml
# Variables used: DncEngPublicBuildPool
- template: /eng/common/templates/variables/pool-providers.yml
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1

stages:
- stage: dnup
displayName: 🔎 dnup tests
jobs:
############### WINDOWS ###############
- template: /eng/pipelines/templates/jobs/dnup-tests.yml@self
parameters:
pool:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals windows.vs2022.amd64.open
os: windows

############### LINUX ###############
- template: /eng/pipelines/templates/jobs/dnup-tests.yml@self
parameters:
os: linux
pool:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals build.ubuntu.2204.amd64.open

############### MACOS ###############
- template: /eng/pipelines/templates/jobs/dnup-tests.yml@self
parameters:
os: macOS
pool:
name: Azure Pipelines
vmImage: macOS-latest

### ARM64 ###
- ${{ if eq(parameters.enableArm64Job, true) }}:
- template: /eng/pipelines/templates/jobs/sdk-job-matrix.yml
parameters:
pool:
name: Azure Pipelines
vmImage: macOS-latest
os: macOS
helixTargetQueue: osx.13.arm64.open
macOSJobParameterSets:
- categoryName: TestBuild
targetArchitecture: arm64
runtimeIdentifier: osx-arm64

58 changes: 58 additions & 0 deletions eng/pipelines/templates/jobs/dnup-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
parameters:
# Basic parameters mirroring style of other job templates
pool: {}
categoryName: dnupTests
dependsOn: ''
variables: {}
oneESCompat:
templateFolderName: templates
publishTaskPrefix: ''
timeoutInMinutes: 60
os: windows

jobs:
- job: ${{ parameters.categoryName }}_${{ parameters.os }}
displayName: 'dnup tests: ${{ parameters.os }}'
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
pool: ${{ parameters.pool }}
dependsOn: ${{ parameters.dependsOn }}
variables:
- ${{ insert }}: ${{ parameters.variables }}
steps:
- ${{ if eq(parameters.os, 'windows') }}:
- powershell: |
Write-Host "Restoring dnup tests"
dotnet restore test/dnup.Tests/dnup.Tests.csproj
displayName: Restore
- powershell: |
dotnet build test/dnup.Tests/dnup.Tests.csproj -c Release --no-restore
displayName: Build
- powershell: |
dotnet test test/dnup.Tests/dnup.Tests.csproj -c Release --no-build --logger "trx;LogFileName=dnup-tests.trx" --results-directory $(Build.SourcesDirectory)/artifacts/dnupTestResults
displayName: Test
- ${{ if ne(parameters.os, 'windows') }}:
- script: |
echo "Restoring dnup tests"
dotnet restore test/dnup.Tests/dnup.Tests.csproj
displayName: Restore
- script: |
dotnet build test/dnup.Tests/dnup.Tests.csproj -c Release --no-restore
displayName: Build
- script: |
dotnet test test/dnup.Tests/dnup.Tests.csproj -c Release --no-build --logger "trx;LogFileName=dnup-tests.trx" --results-directory $(Build.SourcesDirectory)/artifacts/dnupTestResults
displayName: Test
- task: PublishTestResults@2
displayName: Publish dnup test results
condition: always()
inputs:
testResultsFormat: VSTest
testResultsFiles: '**/dnup-tests.trx'
searchFolder: $(Build.SourcesDirectory)/artifacts/dnupTestResults
testRunTitle: 'dnup ${{ parameters.os }}'
- task: PublishBuildArtifacts@1
displayName: Publish dnup test artifacts
condition: always()
inputs:
PathtoPublish: $(Build.SourcesDirectory)/artifacts/dnupTestResults
ArtifactName: dnupTestResults_${{ parameters.os }}
publishLocation: Container