Skip to content

Commit 6769748

Browse files
authored
Update dartlab pipeline setup (#81807)
Reuses the setup-pr-validation script to follow the same process the pr-validation pipeline does
1 parent 9129b60 commit 6769748

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

azure-pipelines-integration-dartlab.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ parameters:
3131
- name: sha
3232
type: string
3333
default: 'None'
34+
- name: EnforceLatestCommit
35+
type: boolean
36+
default: true
3437
# Set to 'stop' if you want to keep the test machines around for investigation after test completion.
3538
- name: testMachineCleanUpStrategy
3639
displayName: Test Machine Clean Up Strategy
@@ -93,6 +96,13 @@ stages:
9396
- checkout: RoslynMirror
9497
fetchDepth: 1
9598
fetchTags: false
99+
- ${{ if ne(parameters.prNumber, 'None') }}:
100+
- task: PowerShell@2
101+
displayName: Setup branch for validation
102+
inputs:
103+
filePath: 'eng\setup-pr-validation.ps1'
104+
arguments: "-sourceBranchName $(Build.SourceBranch) -prNumber ${{ parameters.prNumber }} -commitSHA ${{ parameters.sha }} -enforceLatestCommit ${{ iif(parameters.EnforceLatestCommit, '1', '0') }}"
105+
condition: succeeded()
96106
- template: eng/pipelines/test-integration-job.yml
97107
parameters:
98108
configuration: $(_configuration)

eng/setup-pr-validation.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ try {
1919
exit 1
2020
}
2121

22+
git remote add gh https://github.com/dotnet/roslyn.git
23+
2224
if ($enforceLatestCommit) {
2325
Write-Host "Validating the PR head matches the specified commit SHA ($commitSHA)..."
2426
Write-Host "Getting the hash of refs/pull/$prNumber/head..."
25-
$remoteRef = git ls-remote origin refs/pull/$prNumber/head
27+
$remoteRef = git ls-remote gh refs/pull/$prNumber/head
2628
Write-Host ($remoteRef | Out-String)
2729

2830
$prHeadSHA = $remoteRef.Split()[0]

0 commit comments

Comments
 (0)