File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828 run : curl https://curl.se/ca/cacert.pem -o build/public-certs.pem
2929
3030 - name : Zip Lambda
31- run : zip -r -qq proxy-lambda.zip build node_modules
31+ run : bun run package
3232
3333 - name : Upload Release Assets
3434 uses : softprops/action-gh-release@v3
Original file line number Diff line number Diff line change 2929 - name : Build
3030 run : bun run build
3131
32+ - name : Setup Node
33+ uses : actions/setup-node@v7
34+ with :
35+ # Keep in sync with the Lambda runtime in lambda.tf
36+ node-version : 20
37+
38+ - name : Smoke Test Lambda Bundle
39+ # Load the handler from the packaged zip the way Lambda does: as CommonJS, with
40+ # require(esm) and module syntax detection off, so an ESM bundle fails here too.
41+ run : |
42+ bun run package
43+ unzip -q proxy-lambda.zip -d "$RUNNER_TEMP/lambda"
44+ cd "$RUNNER_TEMP/lambda"
45+ node --no-experimental-require-module --no-experimental-detect-module -e "
46+ if (typeof require('./build/proxy.js').handler !== 'function') throw new Error('build/proxy.js does not export handler');
47+ "
48+
3249 - name : Test
3350 run : bun run test
3451
Original file line number Diff line number Diff line change 44 "main" : " lambdas/proxy/index.js" ,
55 "type" : " module" ,
66 "scripts" : {
7- "build" : " bun build lambda/proxy.ts --outdir build/ --target node" ,
7+ "build" : " bun build lambda/proxy.ts --outdir build/ --target node --format cjs" ,
8+ "package" : " zip -r -qq proxy-lambda.zip build node_modules" ,
89 "format" : " prettier --write ." ,
910 "format-check" : " prettier --check ." ,
1011 "test" : " bun test"
You can’t perform that action at this time.
0 commit comments