diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4431d61..9e73d1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,8 @@ jobs: run: ./build_all.ps1 shell: pwsh - name: Test - run: yarn test + run: ./test_all.ps1 + shell: pwsh - name: Stamping NPM versions run: .github/workflows/set_version.ps1 -Version ${{ steps.nbgv.outputs.NpmPackageVersion }} diff --git a/test_all.ps1 b/test_all.ps1 new file mode 100644 index 0000000..bb46989 --- /dev/null +++ b/test_all.ps1 @@ -0,0 +1,26 @@ +# This script is necessary until https://github.com/kulshekhar/ts-jest/issues/1343 is fixed. +# In particular, we need this addressed: https://github.com/kulshekhar/ts-jest/issues/1109 + +$testOrder = Get-ChildItem "$PSScriptRoot\*cloudbuild-task-*" -Directory + +$failed = $false +$testOrder | % { + Write-Host -ForegroundColor Blue "Testing $($_.BaseName)" + Push-Location $_ + try { + yarn jest + if ($LASTEXITCODE -ne 0) { + $failed = $true + } + } + finally { + Pop-Location + } +} + +if ($failed) { + Write-Host -ForegroundColor Red "Overall test run failure" + exit 1 +} else { + Write-Host -ForegroundColor Green "All tests passed!" +}