Skip to content

Commit 60317c5

Browse files
Merge pull request #27 from theohbrothers/refactor/ci-use-a-job-group-key-to-group-jobs
Refactor (ci): Use a `job_group_key` to group jobs
2 parents 78da98d + 88b9af8 commit 60317c5

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

.github/workflows/ci-master-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
test-nogitdiff:
1515
runs-on: ubuntu-latest
1616
container:
17-
image: mcr.microsoft.com/powershell:7.2.2-alpine-3.14-20220318
17+
image: mcr.microsoft.com/powershell:lts-7.2-alpine-3.17
1818
steps:
1919
- run: |
2020
apk add --no-cache git

.vscode/tasks.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
"-c",
1212
"Generate-DockerImageVariants ."
1313
],
14-
"group": {
15-
"kind": "build",
16-
"isDefault": true
17-
}
14+
"group": "build"
1815
},
1916
{
2017
"label": "Install DockerImageVariants module",

generate/definitions/VARIANTS.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ $VARIANTS = @(
2424
@{
2525
# Metadata object
2626
_metadata = @{
27-
package_version = $variant['distro_version']
2827
distro = $variant['distro']
2928
distro_version = $variant['distro_version']
3029
components = $subVariant['components']
30+
job_group_key = $variant['distro_version']
3131
}
3232
# Docker image tag. E.g. '3.8-openssl'
3333
tag = @(

generate/templates/.github/workflows/ci-master-pr.yml.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
test-nogitdiff:
1616
runs-on: ubuntu-latest
1717
container:
18-
image: mcr.microsoft.com/powershell:7.2.2-alpine-3.14-20220318
18+
image: mcr.microsoft.com/powershell:lts-7.2-alpine-3.17
1919
steps:
2020
- run: |
2121
apk add --no-cache git
@@ -36,7 +36,7 @@ jobs:
3636
'@
3737

3838
# Group variants by the package version
39-
$groups = $VARIANTS | Group-Object -Property { $_['_metadata']['package_version'] } | Sort-Object -Property { [version]$_.Name } -Descending
39+
$groups = $VARIANTS | Group-Object -Property { $_['_metadata']['job_group_key'] } | Sort-Object { [version]$_.Name.Split('-')[0] } -Descending
4040
$WORKFLOW_JOB_NAMES = $groups | % { "build-$( $_.Name.Replace('.', '-') )" }
4141
foreach ($g in $groups) {
4242
@"

0 commit comments

Comments
 (0)