@@ -7,55 +7,55 @@ param (
7
7
8
8
echo " build: Build started"
9
9
10
- Push-Location $PSScriptRoot
10
+ Push-Location " $PSScriptRoot "
11
11
12
- if (Test-Path .\artifacts) {
13
- echo " build: Cleaning .\artifacts"
14
- Remove-Item .\artifacts - Force - Recurse
12
+ if (Test-Path .\artifacts) {
13
+ echo " build: Cleaning .\artifacts"
14
+ Remove-Item .\artifacts - Force - Recurse
15
15
}
16
16
17
17
& dotnet restore -- no- cache
18
18
19
- $branch = @ { $true = $env: GITHUB_REF_NAME ; $false = $ (git symbolic- ref -- short - q HEAD) }[$env: GITHUB_REF_NAME -ne $NULL ];
20
- $revision = @ { $true = " {0:00000}" -f [convert ]::ToInt32(" 0" + $env: GITHUB_RUN_NUMBER , 10 ); $false = " local" }[$env: GITHUB_RUN_NUMBER -ne $NULL ];
21
- $suffix = @ { $true = " " ; $false = " $ ( $branch.Substring (0 , [math ]::Min(10 , $branch.Length ))) -$revision " }[$branch -ne " dev" -and $revision -ne " local" ]
19
+ $branch = @ { $true = $env: GITHUB_REF_NAME ; $false = $ (git symbolic- ref -- short - q HEAD) }[$env: GITHUB_REF_NAME -ne $NULL ]
20
+ $revision = @ { $true = " {0:00000}" -f [convert ]::ToInt32(" 0" + $env: GITHUB_RUN_NUMBER , 10 ); $false = " local" }[$env: GITHUB_RUN_NUMBER -ne $NULL ]
21
+ $suffix = @ { $true = " " ; $false = " $ ( $branch.Substring (0 , [math ]::Min(10 , $branch.Length ))) -$revision " }[$branch -ne " dev" -and $revision -ne " local" ]
22
22
23
23
echo " build: Version suffix is $suffix "
24
24
25
- foreach ($src in ls src /* ) {
26
- Push-Location $src
25
+ foreach ($src in Get-ChildItem " $PSScriptRoot /src " - Directory ) {
26
+ Push-Location $src.FullName
27
27
28
- echo " build: Packaging project in $src "
28
+ echo " build: Packaging project in $ ( $ src.FullName ) "
29
29
30
30
if ($suffix ) {
31
31
& dotnet pack - c Release - o ..\..\artifacts -- version- suffix= $suffix
32
32
} else {
33
33
& dotnet pack - c Release - o ..\..\artifacts
34
34
}
35
- if ($LASTEXITCODE -ne 0 ) { exit 1 }
35
+ if ($LASTEXITCODE -ne 0 ) { exit 1 }
36
36
37
37
Pop-Location
38
38
}
39
39
40
40
if ($SkipTests -eq $false ) {
41
- foreach ($test in ls test / * .PerformanceTests) {
42
- Push-Location $test
41
+ foreach ($test in Get-ChildItem " $PSScriptRoot /test " - Filter " *.PerformanceTests" - Directory ) {
42
+ Push-Location $test.FullName
43
43
44
- echo " build: Building performance test project in $test "
44
+ echo " build: Building performance test project in $ ( $ test.FullName ) "
45
45
46
46
& dotnet build - c Release
47
- if ($LASTEXITCODE -ne 0 ) { exit 2 }
47
+ if ($LASTEXITCODE -ne 0 ) { exit 2 }
48
48
49
49
Pop-Location
50
50
}
51
51
52
- foreach ($test in ls test / * .Tests) {
53
- Push-Location $test
52
+ foreach ($test in Get-ChildItem " $PSScriptRoot /test " - Filter " *.Tests" - Directory ) {
53
+ Push-Location $test.FullName
54
54
55
- echo " build: Testing project in $test "
55
+ echo " build: Testing project in $ ( $ test.FullName ) "
56
56
57
57
& dotnet test - c Release -- collect " XPlat Code Coverage"
58
- if ($LASTEXITCODE -ne 0 ) { exit 3 }
58
+ if ($LASTEXITCODE -ne 0 ) { exit 3 }
59
59
60
60
Pop-Location
61
61
}
0 commit comments