Skip to content

Commit 71afbc2

Browse files
committed
Add missing files from last merge
1 parent 103337a commit 71afbc2

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright (c) .NET Foundation and Contributors
2+
# See LICENSE file in the project root for full license information.
3+
4+
steps:
5+
- task: PowerShell@2
6+
name: Check_mscorlib_test
7+
displayName: Check mscorlib to test
8+
condition: ne(variables['System.PullRequest.PullRequestId'], '')
9+
inputs:
10+
failOnStderr: false
11+
targetType: "inline"
12+
script: |
13+
14+
# compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
15+
# 'encoded token' is the Base64 of the string "nfbot:personal-token"
16+
$auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$(GitHubToken)")))"
17+
18+
# find PR
19+
"Getting PR#$env:System_PullRequest_PullRequestNumber details..." | Write-Host -ForegroundColor White -NoNewline
20+
$pr = Invoke-WebRequest "https://api.github.com/repos/$env:Build_Repository_Name/pulls/$env:System_PullRequest_PullRequestNumber" | ConvertFrom-Json
21+
22+
if($($pr.number) -eq "$env:System_PullRequest_PullRequestNumber")
23+
{
24+
'##[command] OK' | Write-Host -ForegroundColor Green
25+
}
26+
27+
# grab PR commit message
28+
$prCommitMessage = $($pr.body)
29+
30+
# look for test prompt in PR commit message
31+
# pattern is "Tested against nanoframework/CoreLibrary#NNNN"
32+
33+
if($prCommitMessage -match "Tested against nanoframework/CoreLibrary#(\d+)")
34+
{
35+
$testPR = $matches[1]
36+
"Test PR found: $testPR" | Write-Host -ForegroundColor White
37+
38+
# move to the build sources directory
39+
Set-Location -Path $(Agent.BuildDirectory)/s/CoreLibrary
40+
41+
# need to call this first to setup authentication
42+
gh auth setup-git
43+
44+
# gh auth status
45+
46+
Write-Host "Checking out mscorlib PR: #$testPR"
47+
gh pr checkout $testPR
48+
}
49+
else
50+
{
51+
"No test PR found. Using main branch" | Write-Host -ForegroundColor White
52+
}
53+
env:
54+
GITHUB_TOKEN: $(GitHubToken)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (c) .NET Foundation and Contributors
2+
# See LICENSE file in the project root for full license information.
3+
4+
parameters:
5+
- name: repoDirectory
6+
type: string
7+
default: $(Agent.BuildDirectory)/s
8+
9+
steps:
10+
11+
- task: Cache@2
12+
displayName: Cache IDF repository
13+
inputs:
14+
key: 'esp-idf | "$(IDF_TAG)"'
15+
path: $(Agent.BuildDirectory)/s/esp-idf
16+
cacheHitVar: ESP32_IDF_REPO_RESTORED
17+
18+
- task: PowerShell@2
19+
displayName: Checkout IDF repository
20+
condition: ne(variables.ESP32_IDF_REPO_RESTORED, 'true')
21+
inputs:
22+
targetType: "inline"
23+
script: |
24+
# create directory for IDF, ignore if it already exists
25+
New-Item -Path ${{ parameters.repoDirectory }} -ItemType "directory" -ErrorAction SilentlyContinue
26+
# move to the build sources directory
27+
Set-Location -Path ${{ parameters.repoDirectory }}
28+
git clone --recurse-submodules --shallow-submodules --single-branch --depth 1 --branch $(IDF_TAG) https://github.com/espressif/esp-idf

0 commit comments

Comments
 (0)