Skip to content

Commit

Permalink
Work CI-CD
Browse files Browse the repository at this point in the history
- 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***
  • Loading branch information
josesimoes committed Jan 30, 2025
1 parent d03416c commit 1da6e94
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 29 deletions.
37 changes: 11 additions & 26 deletions azure-pipelines-templates/check-mscorlib-to-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,20 @@ steps:
$testPR = $matches[1]
"Test PR found: $testPR" | Write-Host -ForegroundColor White
# store github reference in variable
Write-Host "##vso[task.setvariable variable=TEST_PR;isOutput=true]$testPR"
}
else
{
"No test PR found." | Write-Host -ForegroundColor White
# move to the build sources directory
Set-Location -Path $(Agent.BuildDirectory)/s/CoreLibrary
# use default (main) branch for tests
Write-Host "##vso[task.setvariable variable=TEST_PR;isOutput=true]"
}
# need to call this first to setup authentication
gh auth setup-git
- task: PowerShell@2
displayName: Checkout mscorlib
condition: ne(variables['System.PullRequest.PullRequestId'], '')
inputs:
targetType: "inline"
script: |
# create directory for mscorlib, ignore if it already exists
New-Item -Path $(Agent.BuildDirectory)/s -ItemType "directory" -ErrorAction SilentlyContinue
# move to the build sources directory
Set-Location -Path $(Agent.BuildDirectory)/s
if($(Check_mscorlib_test.TEST_PR) -ne "")
{
Write-Host "Checking out mscorlib PR: #$(Check_mscorlib_test.TEST_PR)"
gh pr checkout $(Check_mscorlib_test.TEST_PR) --recurse-submodules
# gh auth status
Write-Host "Checking out mscorlib PR: #$testPR"
gh pr checkout $testPR
}
else
{
Write-Host "Checking out mscorlib main branch"
gh repo clone nanoframework/CoreLibrary CoreLibrary --recurse-submodules
"No test PR found. Using main branch" | Write-Host -ForegroundColor White
}
env:
GITHUB_TOKEN: $(GitHubToken)
13 changes: 10 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ resources:
name: espressif/esp-idf
endpoint: nanoframework
ref: refs/tags/v5.2.3
- repository: mscorlib
type: github
name: nanoframework/CoreLibrary
endpoint: nanoframework
- repository: littlefs
type: github
name: littlefs-project/littlefs
Expand Down Expand Up @@ -357,7 +361,7 @@ jobs:
- template: azure-pipelines-templates/download-install-llvm.yml
- template: azure-pipelines-templates/check-code-style.yml

################
###############
# STM32
- job: Build_STM32_targets
condition: >-
Expand Down Expand Up @@ -1212,7 +1216,7 @@ jobs:
succeeded('Build_nanoCLR_CLI'),
ne(dependencies.Check_Build_Options.outputs['BuildOptions.SKIP_BUILD'], true),
or(
eq(variables['RUN_MSCORLIB_TESTS__'], true)
eq(variables['RUN_MSCORLIB_TESTS__'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_ALL'], true),
eq(dependencies.Check_Build_Options.outputs['TargetsToBuild.BUILD_NANOCLR_CLI'], true),
eq(dependencies.Check_Build_Options.outputs['BuildOptions.RUN_MSCORLIB_TESTS'], true)
Expand All @@ -1234,7 +1238,10 @@ jobs:
steps:
- checkout: self
fetchDepth: 1
path: s/nf-interpreter
- checkout: mscorlib
fetchDepth: 100
submodules: true
persistCredentials: true

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

Expand Down

0 comments on commit 1da6e94

Please sign in to comment.