Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor (ci): Use a job_group_key to group jobs #35

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-master-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
test-nogitdiff:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/powershell:7.2.2-alpine-3.14-20220318
image: mcr.microsoft.com/powershell:lts-7.2-alpine-3.17
steps:
- run: |
apk add --no-cache git
Expand Down
5 changes: 1 addition & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
"-c",
"Generate-DockerImageVariants ."
],
"group": {
"kind": "build",
"isDefault": true
}
"group": "build"
},
{
"label": "Install DockerImageVariants module",
Expand Down
2 changes: 1 addition & 1 deletion generate/definitions/VARIANTS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ $VARIANTS = @(
@{
# Metadata object
_metadata = @{
package_version = $variant['distro_version']
distro = $variant['distro']
distro_version = $variant['distro_version']
platforms = & {
Expand All @@ -36,6 +35,7 @@ $VARIANTS = @(
}
}
components = $subVariant['components']
job_group_key = $variant['distro_version']
}
# Docker image tag. E.g. '3.8-curl'
tag = @(
Expand Down
4 changes: 2 additions & 2 deletions generate/templates/.github/workflows/ci-master-pr.yml.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
test-nogitdiff:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/powershell:7.2.2-alpine-3.14-20220318
image: mcr.microsoft.com/powershell:lts-7.2-alpine-3.17
steps:
- run: |
apk add --no-cache git
Expand All @@ -36,7 +36,7 @@ jobs:
'@

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