Skip to content

Commit f832aa4

Browse files
committed
Split name and SpawnImage in the matrix setup.
1 parent 59311aa commit f832aa4

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

.github/workflows/build_and_test_on_spawn.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ on:
1111
workflow_dispatch:
1212
inputs:
1313
spawnDataImages:
14-
description: 'names of the data-images on spawn (e.g. ["mssql","empty-mssql"]) aka 2017 and 2019'
14+
description: 'names of the data-images on spawn (e.g. all is currently equivalent to [["SQL2017","mssql-empty:v2017"],["SQL2019","mssql-empty:v2019"]] 2021-09-26)'
1515
required: true
16-
default: '["mssql-empty:2017","mssql-empty:2019"]' # If you change this, remember to also update env.SPAWNDATAIMAGES_DEFAULT
16+
default: 'all'
1717

1818
env:
19-
SPAWNDATAIMAGES_DEFAULT: '["mssql-empty:v2017","mssql-empty:v2019"]'
19+
MATRIX_NAME: 0
20+
MATRIX_SPAWNIMAGE: 1
21+
SPAWNDATAIMAGES_DEFAULT:
22+
'[["SQL2017","mssql-empty:v2017"],["SQL2019","mssql-empty:v2019"]]'
2023

2124
jobs:
2225
# 💖 💖 💖 💖 💖 💖 💖 💖 💖 💖 💖 💖 💖 💖
@@ -40,7 +43,7 @@ jobs:
4043
Write-Host "✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ";
4144
Write-Host "";
4245
Write-Host ("input spawnDataImages: {0}" -f $spawnDataImages);
43-
if ([string]::IsNullOrEmpty($spawnDataImages)) {
46+
if ([string]::IsNullOrEmpty($spawnDataImages) -or ("all" -eq $spawnDataImages)) {
4447
$spawnDataImages = '${{ env.spawndataimages_default }}';
4548
}
4649
Write-Host ("final spawnDataImages value: {0}" -f $spawnDataImages);
@@ -151,7 +154,7 @@ jobs:
151154
run: |
152155
& "${{ github.workspace }}\spawnctl.exe" get data-images
153156
154-
$dataImageName = "${{ matrix.data-image }}";
157+
$dataImageName = "${{ matrix.data-image[MATRIX_SPAWNIMAGE] }}";
155158
156159
echo "Creating 'tSQLtOnLinux' Spawn data container from image '$dataImageName'";
157160
$containerName= & "${{ github.workspace }}\spawnctl.exe" create data-container --image $dataImageName --lifetime 30m -q
@@ -318,7 +321,7 @@ jobs:
318321
run: |
319322
& "${{ github.workspace }}\spawnctl.exe" get data-images
320323
321-
$dataImageName = "${{ matrix.data-image }}";
324+
$dataImageName = "${{ matrix.data-image[MATRIX_SPAWNIMAGE] }}";
322325
323326
echo "Creating 'tSQLtOnLinux' Spawn data container from image '$dataImageName'";
324327
$containerName= & "${{ github.workspace }}\spawnctl.exe" create data-container --image $dataImageName --lifetime 30m -q
@@ -368,7 +371,7 @@ jobs:
368371
uses: actions/upload-artifact@v2
369372
with:
370373
if-no-files-found: error
371-
name: jUnitTests-${{ matrix.data-image }}
374+
name: jUnitTests-${{ matrix.data-image[MATRIX_NAME] }}
372375
path: "${{ env.test_artifact_dir }}\\"
373376
retention-days: 90
374377

0 commit comments

Comments
 (0)