Skip to content

Commit 3247ea1

Browse files
committed
feat: add PostgreSQL version to GitHub Actions job names
When building a postgres extension, the build matrix may include multiple time the same extension for different PostgreSQL versions. This change makes it easier to identify which job corresponds to which PostgreSQL version in the workflow runs.
1 parent 5abba2b commit 3247ea1

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

.github/workflows/nix-build.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ jobs:
2222
NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }}
2323

2424
nix-build-aarch64-linux:
25-
name: ${{ matrix.name }} (aarch64-linux)
25+
name: >-
26+
${{ matrix.name }}${{ matrix.postgres_version && format(' - Postgres {0}', matrix.postgres_version) || '' }}
27+
(aarch64-linux)
2628
needs: nix-eval
2729
runs-on: ${{ matrix.runs_on.group && matrix.runs_on || matrix.runs_on.labels }}
2830
if: ${{ fromJSON(needs.nix-eval.outputs.matrix).aarch64_linux != null }}
@@ -40,7 +42,9 @@ jobs:
4042
run: nix build --accept-flake-config -L .#${{ matrix.attr }}
4143

4244
nix-build-aarch64-darwin:
43-
name: ${{ matrix.name }} (aarch64-darwin)
45+
name: >-
46+
${{ matrix.name }}${{ matrix.postgres_version && format(' - Postgres {0}', matrix.postgres_version) || '' }}
47+
(aarch64-darwin)
4448
needs: nix-eval
4549
runs-on: ${{ matrix.runs_on.group && matrix.runs_on || matrix.runs_on.labels }}
4650
if: ${{ fromJSON(needs.nix-eval.outputs.matrix).aarch64_darwin != null }}
@@ -58,7 +62,9 @@ jobs:
5862
run: nix build --accept-flake-config -L .#${{ matrix.attr }}
5963

6064
nix-build-x86_64-linux:
61-
name: ${{ matrix.name }} (x86_64-linux)
65+
name: >-
66+
${{ matrix.name }}${{ matrix.postgres_version && format(' - Postgres {0}', matrix.postgres_version) || '' }}
67+
(x86_64-linux)
6268
needs: nix-eval
6369
runs-on: ${{ matrix.runs_on.group && matrix.runs_on || matrix.runs_on.labels }}
6470
if: ${{ fromJSON(needs.nix-eval.outputs.matrix).x86_64_linux != null }}

scripts/github-matrix.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,17 @@ def main() -> None:
198198

199199
def clean_package_for_output(pkg: GitHubActionPackage) -> dict:
200200
"""Remove debug fields from package for final output"""
201-
return {
201+
returned_pkg = {
202202
"attr": pkg["attr"],
203203
"name": pkg["name"],
204204
"system": pkg["system"],
205205
"runs_on": pkg["runs_on"],
206-
**(
207-
{"postgresql_version": pkg["postgresql_version"]}
208-
if "postgresql_version" in pkg
209-
else {}
210-
),
211206
}
207+
if is_extension_pkg(pkg):
208+
# Extract PostgreSQL version from attribute path
209+
attrs = pkg["attr"].split(".")
210+
returned_pkg["postgresql_version"] = attrs[-3].split("_")[-1]
211+
return returned_pkg
212212

213213
# Group packages by system
214214
grouped_by_system = defaultdict(list)

0 commit comments

Comments
 (0)