Skip to content

Commit f7293ec

Browse files
committed
ci(aws): add production media verification
1 parent 67e7ffe commit f7293ec

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Verify Rend AWS production
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
9+
concurrency:
10+
group: rend-aws-production-verification
11+
cancel-in-progress: false
12+
13+
jobs:
14+
verify:
15+
runs-on: ubuntu-latest
16+
environment: Production
17+
timeout-minutes: 20
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: "22"
24+
25+
- name: Verify public media pipeline
26+
env:
27+
REND_API_BASE_URL: https://api.rend.so
28+
REND_PLAYBACK_BASE_URL: https://video.rend.so
29+
REND_READINESS_API_KEY: ${{ secrets.REND_READINESS_API_KEY }}
30+
run: node scripts/smoke-aws-public.mjs

scripts/smoke-aws-public.mjs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,19 @@ async function signedArtifact(url, cookies, label, headers = {}) {
104104
headers: { cookie: cookieHeader(cookies), ...headers },
105105
redirect: "error",
106106
});
107-
if (!response.ok) throw new Error(`${label} returned HTTP ${response.status}`);
108107
const body = new Uint8Array(await response.arrayBuffer());
108+
if (!response.ok) {
109+
const detail = new TextDecoder()
110+
.decode(body.slice(0, 512))
111+
.replace(/\s+/g, " ")
112+
.trim();
113+
const cache = response.headers.get("x-cache") || "missing";
114+
const contentType = response.headers.get("content-type") || "missing";
115+
throw new Error(
116+
`${label} (${new URL(url).pathname}) returned HTTP ${response.status}; ` +
117+
`x-cache=${cache}; content-type=${contentType}; body=${detail || "empty"}`,
118+
);
119+
}
109120
if (body.byteLength === 0) throw new Error(`${label} returned an empty body`);
110121
return { response, body };
111122
}

0 commit comments

Comments
 (0)