Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions eng/pipelines/typespec-ci.yml
Comment thread
ckairen marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ pr:
jobs:
- job: Validate_All_Specs
pool:
name: azsdk-pool-mms-ubuntu-2204-general
vmImage: ubuntu-22.04
name: $(Pool)
vmImage: $(OSVmImage)
Comment thread
ckairen marked this conversation as resolved.
Outdated
Comment thread
ckairen marked this conversation as resolved.
Outdated

steps:
- script: npm ci
Expand Down
9 changes: 6 additions & 3 deletions eng/scripts/Get-TypeSpec-Folders.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@ param (

$tspFiles = @()
if ([string]::IsNullOrEmpty($TargetBranch) -or [string]::IsNullOrEmpty($SourceBranch)) {
$tspFiles = (Get-ChildItem -path ./specification tspconfig.yaml -Recurse).FullName -replace "$($pwd.Path)/"
$tspFiles = (Get-ChildItem -path ./specification tspconfig.yaml -Recurse).Directory.FullName | ForEach-Object {[IO.Path]::GetRelativePath($($pwd.path), $_)}
}
else {
Write-Host "git -c core.quotepath=off -c i18n.logoutputencoding=utf-8 diff --name-only `"$TargetBranch...$SourceBranch`" -- | Where-Object {`$_.StartsWith('specification')}"
Comment thread
weshaggard marked this conversation as resolved.
$tspFiles = git -c core.quotepath=off -c i18n.logoutputencoding=utf-8 diff --name-only `"$TargetBranch...$SourceBranch`" -- | Where-Object {$_.StartsWith('specification')}
}
$tspFiles -replace '\\', '/'
Comment thread
ckairen marked this conversation as resolved.
Outdated

$typespecFolders = @()
foreach ($file in $tspFiles) {
$file -match 'specification\/[^\/]*\/' | out-null
$typespecFolders += (Get-ChildItem -path $matches[0] tspconfig.yaml -Recurse).Directory.FullName -replace "$($pwd.Path)/"
if ($file -match 'specification\/[^\/]*\/') {
$typespecFolder = (Get-ChildItem -path $matches[0] tspconfig.yaml -Recurse).Directory.FullName | ForEach-Object {[IO.Path]::GetRelativePath($($pwd.path), $_)}
$typespecFolders += $typespecFolder -replace '\\', '/'
}
}
$typespecFolders = $typespecFolders | Select-Object -Unique

Expand Down
1 change: 1 addition & 0 deletions eng/scripts/Validate-TypeSpec.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ param (
$typespecFolders = @()

$typespecFolders = &"$PSScriptRoot/Get-TypeSpec-Folders.ps1" "$SpecsRepoRootDirectory" "$TargetBranch" "$SourceBranch"
$typespecFolders = $typespecFolders.Split('',[System.StringSplitOptions]::RemoveEmptyEntries)
Comment thread
ckairen marked this conversation as resolved.
Outdated

$exitCode = 0
foreach ($typespecFolder in $typespecFolders) {
Expand Down