From c47f7d2431fd9bb56536bfb1a690cafc4fea989a Mon Sep 17 00:00:00 2001 From: ascorbic Date: Wed, 13 Mar 2024 07:44:52 +0000 Subject: [PATCH] chore: setup llrt --- .github/workflows/update-data.yml | 11 ++++++++--- apps/website/src/components/RuntimeCard.vue | 2 ++ .../runtime-compat-data/test/index.test.ts | 19 +++++++++---------- scripts/version.sh | 1 + 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/update-data.yml b/.github/workflows/update-data.yml index 7f68870..a4ff759 100644 --- a/.github/workflows/update-data.yml +++ b/.github/workflows/update-data.yml @@ -42,10 +42,15 @@ jobs: latest: true fileName: llrt-linux-x64.zip out-file-path: downloads - extract: true - - name: Setup $PATH + # Manually unzip because this seems to corrupt the binary + extract: false + + - name: Setup LLRT run: | - echo "$GITHUB_WORKSPACE/downloads" >> $GITHUB_PATH + export $DOWNLOADS="$GITHUB_WORKSPACE/downloads" + unzip $DOWNLOADS/llrt-linux-x64.zip -d $DOWNLOADS + sudo chmod +x $DOWNLOADS/* + echo "$DOWNLOADS" >> $GITHUB_PATH - run: pnpm install - name: Get browser tests uses: actions/checkout@v4 diff --git a/apps/website/src/components/RuntimeCard.vue b/apps/website/src/components/RuntimeCard.vue index e0ec6ee..0a3e068 100644 --- a/apps/website/src/components/RuntimeCard.vue +++ b/apps/website/src/components/RuntimeCard.vue @@ -48,6 +48,8 @@ function getRuntimeInformation(name: string): RuntimeInformation { return { name: 'Deno', github: 'https://github.com/denoland/deno', website: 'https://deno.com' }; case 'fastly': return { name: 'fastly', github: 'https://github.com/fastly/js-compute-runtime', website: 'https://www.fastly.com/products/compute' }; + case 'llrt': + return { name: 'LLRT', github: 'https://github.com/awslabs/llrt' }; case 'netlify': return { name: 'netlify', website: 'https://docs.netlify.com/edge-functions/overview' }; case 'node': diff --git a/packages/runtime-compat-data/test/index.test.ts b/packages/runtime-compat-data/test/index.test.ts index 7f6aa88..a7f5f15 100644 --- a/packages/runtime-compat-data/test/index.test.ts +++ b/packages/runtime-compat-data/test/index.test.ts @@ -1,4 +1,5 @@ /* eslint-disable yield-star-spacing */ +import { readdir } from "node:fs/promises"; import { expect, it, describe } from "vitest"; import data from ".." assert { type: "json" }; @@ -28,19 +29,17 @@ const skipKeys = new Set([ ]); describe("runtime-compat-data", () => { - it("generates valid data", () => { + it("generates valid data", async () => { + const keys = await readdir( + new URL("../../../generator/runtimes", import.meta.url), + ); + for (const [path, value] of walk(data)) { const key = path.join("."); if (path.at(-1) === "__compat") { - expect(Object.keys(value.support ?? {}), `${key}.support`).toEqual([ - "bun", - "deno", - "edge-light", - "fastly", - "netlify", - "node", - "workerd", - ]); + expect(Object.keys(value.support ?? {}), `${key}.support`).toEqual( + keys, + ); } else if (!skipKeys.has(key)) { expect("__compat" in value, key).toBeTruthy(); } diff --git a/scripts/version.sh b/scripts/version.sh index f31b1f5..ac2cfbd 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -5,6 +5,7 @@ echo "- bun: `bun -v`" echo "- deno: `deno --version | head -n 1`" echo "- edge-light: `pnpm run --filter edge-light-runtime version | tail -n 1`" echo "- fastly: `fastly version | head -n 1`" +echo "- llrt: `llrt -v`" echo "- netlify: `netlify -v`" echo "- node: `node -v`" echo "- workerd: `pnpm run --filter workerd-runtime version | tail -n 1`"