Skip to content

Commit c7e95cb

Browse files
committed
Add basic yml for running PR tests in dnup
we will want to consolidate this into the SDK later.
1 parent 1fc9790 commit c7e95cb

File tree

2 files changed

+116
-0
lines changed

2 files changed

+116
-0
lines changed

.vsts-dnup-pr.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
trigger:
2+
branches:
3+
include:
4+
- dnup
5+
paths:
6+
include:
7+
- src/Installer/dnup/
8+
- test/dnup.Tests/
9+
- global.json
10+
- .vsts-dnup-tests.yml
11+
12+
parameters:
13+
- name: enableArm64Job
14+
displayName: Enables the ARM64 job
15+
type: boolean
16+
default: true
17+
18+
variables:
19+
20+
pr:
21+
branches:
22+
include:
23+
- dnup
24+
- main
25+
paths:
26+
include:
27+
- src/Installer/dnup/
28+
- test/dnup.Tests/
29+
- global.json
30+
- .vsts-dnup-tests.yml
31+
32+
variables:
33+
buildConfiguration: Release
34+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
35+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
36+
37+
stages:
38+
- stage: dnup_tests
39+
displayName: dnup tests
40+
jobs:
41+
- template: /eng/pipelines/templates/jobs/dnup-tests.yml@self
42+
parameters:
43+
os: windows
44+
pool:
45+
name: $(DncEngPublicBuildPool)
46+
demands: ImageOverride -equals windows.vs2022.amd64.open
47+
- template: /eng/pipelines/templates/jobs/dnup-tests.yml@self
48+
parameters:
49+
os: linux
50+
pool:
51+
name: $(DncEngPublicBuildPool)
52+
demands: ImageOverride -equals build.ubuntu.2204.amd64.open
53+
- template: /eng/pipelines/templates/jobs/dnup-tests.yml@self
54+
parameters:
55+
os: macOS
56+
pool:
57+
name: Azure Pipelines
58+
vmImage: macOS-latest
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
parameters:
2+
# Basic parameters mirroring style of other job templates
3+
pool: {}
4+
categoryName: dnupTests
5+
dependsOn: ''
6+
variables: {}
7+
oneESCompat:
8+
templateFolderName: templates
9+
publishTaskPrefix: ''
10+
timeoutInMinutes: 60
11+
os: windows
12+
13+
jobs:
14+
- job: ${{ parameters.categoryName }}_${{ parameters.os }}
15+
displayName: 'dnup tests: ${{ parameters.os }}'
16+
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
17+
pool: ${{ parameters.pool }}
18+
dependsOn: ${{ parameters.dependsOn }}
19+
variables:
20+
- ${{ insert }}: ${{ parameters.variables }}
21+
steps:
22+
- ${{ if eq(parameters.os, 'windows') }}:
23+
- powershell: |
24+
Write-Host "Restoring dnup tests"
25+
dotnet restore test/dnup.Tests/dnup.Tests.csproj
26+
displayName: Restore
27+
- powershell: |
28+
dotnet build test/dnup.Tests/dnup.Tests.csproj -c Release --no-restore
29+
displayName: Build
30+
- powershell: |
31+
dotnet test test/dnup.Tests/dnup.Tests.csproj -c Release --no-build --logger "trx;LogFileName=dnup-tests.trx" --results-directory $(Build.SourcesDirectory)/artifacts/dnupTestResults
32+
displayName: Test
33+
- ${{ if ne(parameters.os, 'windows') }}:
34+
- script: |
35+
echo "Restoring dnup tests"
36+
dotnet restore test/dnup.Tests/dnup.Tests.csproj
37+
displayName: Restore
38+
- script: |
39+
dotnet build test/dnup.Tests/dnup.Tests.csproj -c Release --no-restore
40+
displayName: Build
41+
- script: |
42+
dotnet test test/dnup.Tests/dnup.Tests.csproj -c Release --no-build --logger "trx;LogFileName=dnup-tests.trx" --results-directory $(Build.SourcesDirectory)/artifacts/dnupTestResults
43+
displayName: Test
44+
- task: PublishTestResults@2
45+
displayName: Publish dnup test results
46+
condition: always()
47+
inputs:
48+
testResultsFormat: VSTest
49+
testResultsFiles: '**/dnup-tests.trx'
50+
searchFolder: $(Build.SourcesDirectory)/artifacts/dnupTestResults
51+
testRunTitle: 'dnup ${{ parameters.os }}'
52+
- task: PublishBuildArtifacts@1
53+
displayName: Publish dnup test artifacts
54+
condition: always()
55+
inputs:
56+
PathtoPublish: $(Build.SourcesDirectory)/artifacts/dnupTestResults
57+
ArtifactName: dnupTestResults_${{ parameters.os }}
58+
publishLocation: Container

0 commit comments

Comments
 (0)