Skip to content

Commit e352434

Browse files
committed
Revert "fix(ci): do not hide cached builds"
This reverts commit 9d41b1e.
1 parent 48f3d00 commit e352434

File tree

4 files changed

+12
-34
lines changed

4 files changed

+12
-34
lines changed

.github/actions/nix-build-setup/action.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,17 @@ inputs:
88
description: 'AWS role session duration in seconds'
99
required: false
1010
default: '3600'
11-
cached:
12-
description: 'Whether to use cached builds'
13-
required: false
14-
default: 'false'
1511

1612
runs:
1713
using: 'composite'
1814
steps:
1915
- name: aws-oidc
20-
if: ${{ inputs.cached == 'false' }}
2116
uses: aws-actions/[email protected]
2217
with:
2318
aws-region: us-east-2
2419
role-to-assume: arn:aws:iam::279559813984:role/supabase-github-oidc-role # Shared Services
2520
role-session-name: gha-oidc-${{ github.run_id }}
2621
- name: aws-creds
27-
if: ${{ inputs.cached == 'false' }}
2822
uses: aws-actions/[email protected]
2923
with:
3024
disable-retry: true
@@ -35,7 +29,6 @@ runs:
3529
role-skip-session-tagging: true
3630
role-duration-seconds: ${{ inputs.aws-role-duration }}
3731
- name: Write creds files
38-
if: ${{ inputs.cached == 'false' }}
3932
shell: bash
4033
run: |
4134
umask 006
@@ -46,10 +39,5 @@ runs:
4639
aws_session_token = ${AWS_SESSION_TOKEN}
4740
EOF
4841
- name: nix build
49-
if: ${{ inputs.cached == 'false' }}
5042
shell: bash
5143
run: nix build -L .#${{ inputs.attr }}
52-
- name: nix build
53-
if: ${{ inputs.cached == 'true' }}
54-
shell: bash
55-
run: echo "Skipping build of ${{ inputs.attr }} as it's marked cached"

.github/workflows/nix-build.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
run: |
3131
set -Eeu
3232
echo matrix="$(python scripts/github-matrix.py extensions)" >> "$GITHUB_OUTPUT"
33+
# XXX debugging
34+
exit 1
3335
3436
build-extensions-aarch64-linux:
3537
name: ${{matrix.postgresql_version}}.${{ matrix.name }} (aarch64-linux)
@@ -47,7 +49,6 @@ jobs:
4749
uses: ./.github/actions/nix-build-setup
4850
with:
4951
attr: ${{ matrix.attr }}
50-
cached: ${{ matrix.is_cached }}
5152

5253
build-extensions-aarch64-darwin:
5354
name: ${{matrix.postgresql_version}}.${{ matrix.name }} (aarch64-darwin)
@@ -65,7 +66,6 @@ jobs:
6566
uses: ./.github/actions/nix-build-setup
6667
with:
6768
attr: ${{ matrix.attr }}
68-
cached: ${{ matrix.is_cached }}
6969

7070
build-extensions-x86_64-linux:
7171
name: ${{matrix.postgresql_version}}.${{ matrix.name }} (x86_64-linux)
@@ -83,7 +83,6 @@ jobs:
8383
uses: ./.github/actions/nix-build-setup
8484
with:
8585
attr: ${{ matrix.attr }}
86-
cached: ${{ matrix.is_cached }}
8786

8887

8988
checks-matrix:
@@ -118,7 +117,6 @@ jobs:
118117
uses: ./.github/actions/nix-build-setup
119118
with:
120119
attr: ${{ matrix.attr }}
121-
cached: ${{ matrix.is_cached }}
122120

123121
run-tests:
124122
needs: build-checks

nix/packages/postgres.nix

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,10 @@
158158
# install.
159159
# - exts: an attrset containing all the extensions, mapped to their
160160
# package names.
161-
makePostgres =
162-
version:
163-
lib.recurseIntoAttrs {
164-
bin = makePostgresBin version;
165-
exts = makeOurPostgresPkgsSet version;
166-
};
161+
makePostgres = version: lib.recurseIntoAttrs {
162+
bin = makePostgresBin version;
163+
exts = makeOurPostgresPkgsSet version;
164+
};
167165
basePackages = {
168166
psql_15 = makePostgres "15";
169167
psql_17 = makePostgres "17";

scripts/github-matrix.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class GitHubActionPackage(TypedDict):
4646
attr: str
4747
name: str
4848
system: str
49-
is_cached: bool
49+
already_cached: bool
5050
runs_on: RunsOnConfig
5151
postgresql_version: NotRequired[str]
5252

@@ -103,21 +103,17 @@ def parse_nix_eval_line(
103103
try:
104104
data: NixEvalJobsOutput = json.loads(line)
105105
if data["drvPath"] in drv_paths:
106-
print(f"Skipping duplicate drvPath: {data['drvPath']}", file=sys.stderr)
107-
data["cacheStatus"] = "cached"
108-
else:
109-
drv_paths.add(data["drvPath"])
106+
return None
107+
drv_paths.add(data["drvPath"])
110108

111109
runs_on_config = BUILD_RUNNER_MAP[data["system"]]
112110

113111
return {
114112
"attr": f"{target}.{data['attr']}",
115113
"name": data["name"],
116114
"system": data["system"],
117-
"is_cached": data.get("cacheStatus") != "notBuilt",
115+
"already_cached": data.get("cacheStatus") != "notBuilt",
118116
"runs_on": runs_on_config,
119-
"drvPath": data["drvPath"], # For debugging purposes
120-
"outputs": data.get("outputs", {}), # For debugging purposes
121117
}
122118
except json.JSONDecodeError:
123119
print(f"Skipping invalid JSON line: {line}", file=sys.stderr)
@@ -137,7 +133,8 @@ def run_nix_eval_jobs(
137133

138134
for line in process.stdout:
139135
package = parse_nix_eval_line(line, drv_paths, target)
140-
if package:
136+
if package and not package["already_cached"]:
137+
print(f"Found package: {package['attr']}", file=sys.stderr)
141138
yield package
142139

143140
if process.returncode and process.returncode != 0:
@@ -189,9 +186,6 @@ def main() -> None:
189186
grouped_by_system[system] = []
190187
grouped_by_system[system].append(pkg)
191188

192-
print("Grouped packages by system:", file=sys.stderr)
193-
print(json.dumps(grouped_by_system, indent=2), file=sys.stderr)
194-
195189
# Create output with system-specific matrices
196190
gh_output = {}
197191
for system, packages in grouped_by_system.items():

0 commit comments

Comments
 (0)