Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 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
14 changes: 12 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 @@ -20,9 +20,19 @@ pr:

jobs:
- job: Validate_All_Specs

strategy:
matrix:
Linux:
Pool: azsdk-pool-mms-ubuntu-2204-general
OsVmImage: ubuntu-22.04
Windows:
Comment thread
weshaggard marked this conversation as resolved.
Outdated
Pool: azsdk-pool-mms-win-2022-general
OsVmImage: windows-2022
Comment thread
ckairen marked this conversation as resolved.
Outdated

Comment thread
ckairen marked this conversation as resolved.
Outdated
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 @@ -9,8 +9,9 @@ param (
)

$tspFiles = @()
$osSlash = [IO.Path]::DirectorySeparatorChar
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).FullName -replace [Regex]::Escape("$($pwd.Path)$osSlash")
Comment thread
ckairen marked this conversation as resolved.
Outdated
}
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.
Expand All @@ -19,8 +20,10 @@ else {

$typespecFolders = @()
foreach ($file in $tspFiles) {
$file -match 'specification\/[^\/]*\/' | out-null
$typespecFolders += (Get-ChildItem -path $matches[0] tspconfig.yaml -Recurse).Directory.FullName -replace "$($pwd.Path)/"
$file -match "specification\$osSlash[^\$osSlash]*\$osSlash" | out-null
if ($matches) {
$typespecFolders += (Get-ChildItem -path $matches[0] tspconfig.yaml -Recurse).Directory.FullName -replace [Regex]::Escape("$($pwd.Path)$osSlash")
}
Comment thread
ckairen marked this conversation as resolved.
Outdated
}
$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
2 changes: 1 addition & 1 deletion eng/tools/TypeSpecValidation/src/TypeSpecValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export async function main() {
}

// Format parent folder to include shared files
await runCmd(`npx tsp format ../**/*.tsp`, folder);
await runCmd(`npx tsp format ..${path.sep}**${path.sep}*.tsp`, folder);
Comment thread
ckairen marked this conversation as resolved.
Outdated

// Verify generated swagger file is in sync with one on disk
const git = simpleGit();
Expand Down