Skip to content

Commit 1da6e94

Browse files
committed
Work CI-CD
- Fix condition in AZDO yaml. - Add auth env var for GH CLI. - Add back checkout of core library. - Improve template to checkout core library. ***NO_CI***
1 parent d03416c commit 1da6e94

File tree

2 files changed

+21
-29
lines changed

2 files changed

+21
-29
lines changed

azure-pipelines-templates/check-mscorlib-to-test.yml

+11-26
Original file line numberDiff line numberDiff line change
@@ -35,35 +35,20 @@ steps:
3535
$testPR = $matches[1]
3636
"Test PR found: $testPR" | Write-Host -ForegroundColor White
3737
38-
# store github reference in variable
39-
Write-Host "##vso[task.setvariable variable=TEST_PR;isOutput=true]$testPR"
40-
}
41-
else
42-
{
43-
"No test PR found." | Write-Host -ForegroundColor White
38+
# move to the build sources directory
39+
Set-Location -Path $(Agent.BuildDirectory)/s/CoreLibrary
4440
45-
# use default (main) branch for tests
46-
Write-Host "##vso[task.setvariable variable=TEST_PR;isOutput=true]"
47-
}
41+
# need to call this first to setup authentication
42+
gh auth setup-git
4843
49-
- task: PowerShell@2
50-
displayName: Checkout mscorlib
51-
condition: ne(variables['System.PullRequest.PullRequestId'], '')
52-
inputs:
53-
targetType: "inline"
54-
script: |
55-
# create directory for mscorlib, ignore if it already exists
56-
New-Item -Path $(Agent.BuildDirectory)/s -ItemType "directory" -ErrorAction SilentlyContinue
57-
# move to the build sources directory
58-
Set-Location -Path $(Agent.BuildDirectory)/s
59-
60-
if($(Check_mscorlib_test.TEST_PR) -ne "")
61-
{
62-
Write-Host "Checking out mscorlib PR: #$(Check_mscorlib_test.TEST_PR)"
63-
gh pr checkout $(Check_mscorlib_test.TEST_PR) --recurse-submodules
44+
# gh auth status
45+
46+
Write-Host "Checking out mscorlib PR: #$testPR"
47+
gh pr checkout $testPR
6448
}
6549
else
6650
{
67-
Write-Host "Checking out mscorlib main branch"
68-
gh repo clone nanoframework/CoreLibrary CoreLibrary --recurse-submodules
51+
"No test PR found. Using main branch" | Write-Host -ForegroundColor White
6952
}
53+
env:
54+
GITHUB_TOKEN: $(GitHubToken)

azure-pipelines.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ resources:
4949
name: espressif/esp-idf
5050
endpoint: nanoframework
5151
ref: refs/tags/v5.2.3
52+
- repository: mscorlib
53+
type: github
54+
name: nanoframework/CoreLibrary
55+
endpoint: nanoframework
5256
- repository: littlefs
5357
type: github
5458
name: littlefs-project/littlefs
@@ -357,7 +361,7 @@ jobs:
357361
- template: azure-pipelines-templates/download-install-llvm.yml
358362
- template: azure-pipelines-templates/check-code-style.yml
359363

360-
################
364+
###############
361365
# STM32
362366
- job: Build_STM32_targets
363367
condition: >-
@@ -1212,7 +1216,7 @@ jobs:
12121216
succeeded('Build_nanoCLR_CLI'),
12131217
ne(dependencies.Check_Build_Options.outputs['BuildOptions.SKIP_BUILD'], true),
12141218
or(
1215-
eq(variables['RUN_MSCORLIB_TESTS__'], true)
1219+
eq(variables['RUN_MSCORLIB_TESTS__'], true),
12161220
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_ALL'], true),
12171221
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_NANOCLR_CLI'], true),
12181222
eq(dependencies.Check_Build_Options.outputs['BuildOptions.RUN_MSCORLIB_TESTS'], true)
@@ -1234,7 +1238,10 @@ jobs:
12341238
steps:
12351239
- checkout: self
12361240
fetchDepth: 1
1237-
path: s/nf-interpreter
1241+
- checkout: mscorlib
1242+
fetchDepth: 100
1243+
submodules: true
1244+
persistCredentials: true
12381245

12391246
- template: azure-pipelines-templates/check-mscorlib-to-test.yml
12401247

0 commit comments

Comments
 (0)