Skip to content

Commit e6cf613

Browse files
authored
Add internal pipeline for IdentityModel nightlies (#55500)
* Add internal pipeline for IdentityModel nightlies * Fix name
1 parent 6ef0fe5 commit e6cf613

File tree

3 files changed

+123
-13
lines changed

3 files changed

+123
-13
lines changed

.azure/pipelines/helix-matrix.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ schedules:
88
include:
99
- main
1010
always: true
11-
- cron: "0 18 * * *"
12-
branches:
13-
include:
14-
- main
15-
always: true
16-
displayName: IdentityModel test job
1711
- cron: "0 9 * * *"
1812
branches:
1913
include:
@@ -24,8 +18,6 @@ schedules:
2418
variables:
2519
- name: _UseHelixOpenQueues
2620
value: ${{ ne(variables['System.TeamProject'], 'internal') }}
27-
- name: _IsIdentityModelTestJob
28-
value: ${{ eq(variables['Build.CronSchedule.DisplayName'], 'IdentityModel test job') }}
2921
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
3022
- group: DotNet-HelixApi-Access
3123
- template: /eng/common/templates/variables/pool-providers.yml
@@ -38,17 +30,14 @@ jobs:
3830
agentOs: Windows
3931
timeoutInMinutes: 300
4032
steps:
41-
- ${{ if eq(variables['Build.CronSchedule.DisplayName'], 'IdentityModel test job') }}:
42-
- script: echo "##vso[build.addbuildtag]identitymodel-test"
43-
displayName: 'Set CI identitymodel-test tag'
4433
# Build the shared framework
4534
- script: ./eng/build.cmd -ci -prepareMachine -nativeToolsOnMachine -nobl -all -pack -arch x64
46-
/p:CrossgenOutput=false /p:IsIdentityModelTestJob=$(_IsIdentityModelTestJob) /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
35+
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
4736
displayName: Build shared fx
4837
# -noBuildRepoTasks -noBuildNative -noBuild to avoid repeating work done in the previous step.
4938
- script: .\eng\build.cmd -ci -prepareMachine -nobl -all -noBuildRepoTasks -noBuildNative -noBuild -test
5039
-projects eng\helix\helix.proj /p:IsHelixJob=true
51-
/p:CrossgenOutput=false /p:IsIdentityModelTestJob=$(_IsIdentityModelTestJob) /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
40+
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
5241
displayName: Run build.cmd helix target
5342
env:
5443
HelixApiAccessToken: $(HelixApiAccessToken) # Needed for internal queues
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# We only want to run IdentityModel matrix on main
2+
pr: none
3+
trigger: none
4+
schedules:
5+
# Cron timezone is UTC.
6+
- cron: "0 */12 * * *"
7+
branches:
8+
include:
9+
- main
10+
- release/8.0
11+
always: true
12+
13+
variables:
14+
- name: _UseHelixOpenQueues
15+
value: false
16+
- group: DotNet-HelixApi-Access
17+
- template: /eng/common/templates/variables/pool-providers.yml
18+
19+
jobs:
20+
- template: jobs/default-build.yml
21+
parameters:
22+
jobName: IdentityModel_helix_matrix_x64
23+
jobDisplayName: 'Tests: IdentityModel nightlies helix full matrix x64'
24+
agentOs: Windows
25+
timeoutInMinutes: 300
26+
steps:
27+
- task: NuGetAuthenticate@1
28+
- task: NuGetCommand@2
29+
displayName: Install Microsoft.IdentityModel.Logging
30+
inputs:
31+
command: 'custom'
32+
arguments: 'install Microsoft.IdentityModel.Logging
33+
-Source https://pkgs.dev.azure.com/dnceng/internal/_packaging/identitymodel-nightlies/nuget/v3/index.json
34+
-DependencyVersion Highest -PreRelease'
35+
- task: NuGetCommand@2
36+
inputs:
37+
displayName: Install Microsoft.IdentityModel.Protocols.OpenIdConnect
38+
command: 'custom'
39+
arguments: 'install Microsoft.IdentityModel.Protocols.OpenIdConnect
40+
-Source https://pkgs.dev.azure.com/dnceng/internal/_packaging/identitymodel-nightlies/nuget/v3/index.json
41+
-DependencyVersion Highest -PreRelease'
42+
- task: NuGetCommand@2
43+
inputs:
44+
displayName: Install Microsoft.IdentityModel.Protocols.WsFederation
45+
command: 'custom'
46+
arguments: 'install Microsoft.IdentityModel.Protocols.WsFederation
47+
-Source https://pkgs.dev.azure.com/dnceng/internal/_packaging/identitymodel-nightlies/nuget/v3/index.json
48+
-DependencyVersion Highest -PreRelease'
49+
- task: NuGetCommand@2
50+
inputs:
51+
displayName: System.IdentityModel.Tokens.Jwt
52+
command: 'custom'
53+
arguments: 'install System.IdentityModel.Tokens.Jwt
54+
-Source https://pkgs.dev.azure.com/dnceng/internal/_packaging/identitymodel-nightlies/nuget/v3/index.json
55+
-DependencyVersion Highest -PreRelease'
56+
- task: PowerShell@2
57+
displayName: Add IdentityModel feel to NuGet.config
58+
inputs:
59+
filePath: $(Build.SourcesDirectory)/eng/scripts/SetupIdentitySources.ps1
60+
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config
61+
# Build the shared framework
62+
- script: ./eng/build.cmd -ci -prepareMachine -nativeToolsOnMachine -nobl -all -pack -arch x64
63+
/p:CrossgenOutput=false /p:IsIdentityModelTestJob=true /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
64+
displayName: Build shared fx
65+
# -noBuildRepoTasks -noBuildNative -noBuild to avoid repeating work done in the previous step.
66+
- script: .\eng\build.cmd -ci -prepareMachine -nobl -all -noBuildRepoTasks -noBuildNative -noBuild -test
67+
-projects eng\helix\helix.proj /p:IsHelixJob=true
68+
/p:CrossgenOutput=false /p:IsIdentityModelTestJob=true /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
69+
displayName: Run build.cmd helix target
70+
env:
71+
HelixApiAccessToken: $(HelixApiAccessToken) # Needed for internal queues
72+
SYSTEM_ACCESSTOKEN: $(System.AccessToken) # We need to set this env var to publish helix results to Azure Dev Ops
73+
artifacts:
74+
- name: Helix_logs
75+
path: artifacts/log/
76+
publishOnError: true
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[CmdletBinding()]
2+
param (
3+
[Parameter(Mandatory = $true)][string]$ConfigFile
4+
)
5+
6+
$ErrorActionPreference = "Stop"
7+
Set-StrictMode -Version 2.0
8+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
9+
10+
# Add source entry to PackageSources
11+
function AddPackageSource($sources, $SourceName, $SourceEndPoint) {
12+
$packageSource = $sources.SelectSingleNode("add[@key='$SourceName']")
13+
14+
if ($packageSource -eq $null)
15+
{
16+
$packageSource = $doc.CreateElement("add")
17+
$packageSource.SetAttribute("key", $SourceName)
18+
$packageSource.SetAttribute("value", $SourceEndPoint)
19+
$sources.AppendChild($packageSource) | Out-Null
20+
}
21+
else {
22+
Write-Host "Package source $SourceName already present."
23+
}
24+
}
25+
26+
if (!(Test-Path $ConfigFile -PathType Leaf)) {
27+
Write-PipelineTelemetryError -Category 'Build' -Message "eng/scripts/SetupIdentitySources.ps1 returned a non-zero exit code. Couldn't find the NuGet config file: $ConfigFile"
28+
ExitWithExitCode 1
29+
}
30+
31+
# Load NuGet.config
32+
$doc = New-Object System.Xml.XmlDocument
33+
$filename = (Get-Item $ConfigFile).FullName
34+
$doc.Load($filename)
35+
36+
# Get reference to <PackageSources> or create one if none exist already
37+
$sources = $doc.DocumentElement.SelectSingleNode("packageSources")
38+
if ($sources -eq $null) {
39+
$sources = $doc.CreateElement("packageSources")
40+
$doc.DocumentElement.AppendChild($sources) | Out-Null
41+
}
42+
43+
AddPackageSource -Sources $sources -SourceName "identitymodel-nightlies" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/identitymodel-nightlies/nuget/v3/index.json"
44+
45+
$doc.Save($filename)

0 commit comments

Comments
 (0)