From d3327a2deece21a661adcadc4f38d127b4930c10 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Sun, 26 Jan 2025 15:49:01 +0100 Subject: [PATCH] tests/examples: add a Deno integration test --- .github/workflows/test.yml | 36 ++++++++++++++++++++++++++++++++---- package.json | 1 + tests/examples/.gitignore | 1 + tests/examples/package.json | 7 ++++--- 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03735dd..2034b97 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,6 +28,17 @@ jobs: - run: npm run lint - run: npm run test - run: npm run examples:node + esbuild: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: actions/setup-node@v4 + with: + node-version: 22.x + - run: npm update + - run: npm run build - run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns - run: npm run examples:esbuild bun: @@ -36,10 +47,27 @@ jobs: - uses: actions/checkout@v4 with: persist-credentials: false + - uses: actions/setup-node@v4 + with: + node-version: 22.x - uses: oven-sh/setup-bun@v1 with: bun-version: latest - - run: bun update --no-save - - run: bun run build - - run: bun run test:short - - run: bun run examples:bun + - run: npm update + - run: npm run build + - run: npm run examples:bun + deno: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: actions/setup-node@v4 + with: + node-version: 22.x + - uses: denoland/setup-deno@v2 + with: + deno-version: vx.x.x + - run: npm update + - run: npm run build + - run: npm run examples:deno diff --git a/package.json b/package.json index 8bf0fd5..8c7586f 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "test:short": "vitest --run --project node", "examples:node": "cd tests/examples && npm update && npm run test:node", "examples:bun": "cd tests/examples && bun update --no-save && bun run test:bun", + "examples:deno": "cd tests/examples && npm update && deno task test:deno", "examples:esbuild": "cd tests/examples && npm update && npm run test:esbuild", "bench": "vitest bench --run", "lint": "eslint .", diff --git a/tests/examples/.gitignore b/tests/examples/.gitignore index 12c600a..6a42c3d 100644 --- a/tests/examples/.gitignore +++ b/tests/examples/.gitignore @@ -1,4 +1,5 @@ /node_modules /package-lock.json /bun.lockb +/deno.lock /age.js diff --git a/tests/examples/package.json b/tests/examples/package.json index 0f0d67c..0ca7a91 100644 --- a/tests/examples/package.json +++ b/tests/examples/package.json @@ -1,12 +1,13 @@ { "name": "age-examples", "type": "module", - "workspaces": [ - "../.." - ], + "dependencies": { + "age-encryption": "file:../.." + }, "scripts": { "test:node": "node identity.js && node passphrase.js", "test:bun": "bun run identity.js && bun run passphrase.js", + "test:deno": "deno run identity.js && deno run passphrase.js", "build:esbuild": "esbuild --target=es2022 --bundle --minify --outfile=age.js --global-name=age age-encryption", "install:esbuild": "npx puppeteer browsers install chrome", "test:esbuild": "npm run build:esbuild && npm run install:esbuild && node browser.js"