Skip to content
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/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: curl https://curl.se/ca/cacert.pem -o build/public-certs.pem

- name: Zip Lambda
run: zip -r -qq proxy-lambda.zip build node_modules
run: bun run package

- name: Upload Release Assets
uses: softprops/action-gh-release@v3
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,23 @@ jobs:
- name: Build
run: bun run build

- name: Setup Node
uses: actions/setup-node@v7
with:
# Keep in sync with the Lambda runtime in lambda.tf
node-version: 20

- name: Smoke Test Lambda Bundle
# Load the handler from the packaged zip the way Lambda does: as CommonJS, with
# require(esm) and module syntax detection off, so an ESM bundle fails here too.
run: |
bun run package
unzip -q proxy-lambda.zip -d "$RUNNER_TEMP/lambda"
cd "$RUNNER_TEMP/lambda"
node --no-experimental-require-module --no-experimental-detect-module -e "
if (typeof require('./build/proxy.js').handler !== 'function') throw new Error('build/proxy.js does not export handler');
"

- name: Test
run: bun run test

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"main": "lambdas/proxy/index.js",
"type": "module",
"scripts": {
"build": "bun build lambda/proxy.ts --outdir build/ --target node",
"build": "bun build lambda/proxy.ts --outdir build/ --target node --format cjs",
"package": "zip -r -qq proxy-lambda.zip build node_modules",
"format": "prettier --write .",
"format-check": "prettier --check .",
"test": "bun test"
Expand Down
Loading