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
10 changes: 10 additions & 0 deletions azure-pipelines-integration-dartlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ parameters:
- name: sha
type: string
default: 'None'
- name: EnforceLatestCommit
type: boolean
default: true
# Set to 'stop' if you want to keep the test machines around for investigation after test completion.
- name: testMachineCleanUpStrategy
displayName: Test Machine Clean Up Strategy
Expand Down Expand Up @@ -93,6 +96,13 @@ stages:
- checkout: RoslynMirror
fetchDepth: 1
fetchTags: false
- ${{ if ne(parameters.prNumber, 'None') }}:
- task: PowerShell@2
displayName: Setup branch for validation
inputs:
filePath: 'eng\setup-pr-validation.ps1'
arguments: "-sourceBranchName $(Build.SourceBranch) -prNumber ${{ parameters.prNumber }} -commitSHA ${{ parameters.sha }} -enforceLatestCommit ${{ iif(parameters.EnforceLatestCommit, '1', '0') }}"
condition: succeeded()
- template: eng/pipelines/test-integration-job.yml
parameters:
configuration: $(_configuration)
Expand Down
4 changes: 3 additions & 1 deletion eng/setup-pr-validation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ try {
exit 1
}

git remote add gh https://github.com/dotnet/roslyn.git

if ($enforceLatestCommit) {
Write-Host "Validating the PR head matches the specified commit SHA ($commitSHA)..."
Write-Host "Getting the hash of refs/pull/$prNumber/head..."
$remoteRef = git ls-remote origin refs/pull/$prNumber/head
$remoteRef = git ls-remote gh refs/pull/$prNumber/head
Write-Host ($remoteRef | Out-String)

$prHeadSHA = $remoteRef.Split()[0]
Expand Down