File tree Expand file tree Collapse file tree 1 file changed +24
-11
lines changed Expand file tree Collapse file tree 1 file changed +24
-11
lines changed Original file line number Diff line number Diff line change @@ -51,30 +51,43 @@ jobs:
51
51
id : Gather-Tests
52
52
with :
53
53
ShowOutput : true
54
+ WorkingDirectory : ${{ inputs.Path }}
54
55
Script : |
55
- $rootPath = Resolve-Path -Path '${{ inputs.Path }}'
56
- $testsPath = Join-Path -Path $rootPath -ChildPath 'tests'
56
+ $shellsToTest = @('pwsh')
57
+ $OSsToTest = @('ubuntu-latest', 'macos-latest', 'windows-latest')
58
+
59
+ $testsPath = Resolve-Path 'tests' | Select-Object -ExpandProperty Path
57
60
if (-not (Test-Path -Path $testsPath)) {
58
61
Write-Host "No tests found"
59
62
exit 0
60
63
}
61
64
62
65
$testSuites = @()
63
- Get-ChildItem -Path $testsPath -Directory | ForEach-Object {
64
- $filePath = $_.FullName
65
- }
66
+ Get-ChildItem -Path $testsPath -Directory
66
67
if (-not $testSuites) {
67
68
$testSuites += @($testsPath)
68
69
}
69
70
70
- 'ubuntu-latest', 'macos-latest', 'windows-latest' | ForEach-Object {
71
- $testSuites = @{
72
- RunsOn = $_
73
- FullName = $filePath
71
+ $tests = @()
72
+ $OSsToTest | ForEach-Object {
73
+ $os = $_
74
+ $testSuites | ForEach-Object {
75
+ $testSuite = $_
76
+ $shellsToTest | ForEach-Object {
77
+ $shell = $_
78
+ $testPath = Resolve-Path -Path $testSuite | Select-Object -ExpandProperty Path
79
+ $test = @{}
80
+ $test += @{
81
+ OS = $os
82
+ Path = $testPath
83
+ Shell = $shell
84
+ }
85
+ $tests += @($test)
74
86
}
75
87
}
88
+ }
76
89
77
90
78
- Write-Output ($testSuites | ConvertTo-Json -Depth 10)
91
+ Write-Output ($tests | ConvertTo-Json -Depth 10)
79
92
80
- Set-GitHubOutput -Name TestSuites -Value ($testSuites | ConvertTo-Json -Depth 10)
93
+ Set-GitHubOutput -Name Tests -Value ($tests | ConvertTo-Json -Depth 10 -Compress )
You can’t perform that action at this time.
0 commit comments