From 2e30d25a7c32f0582440833e0748647d753d521a Mon Sep 17 00:00:00 2001 From: Ajitomi Daisuke Date: Sun, 1 Sep 2024 16:00:58 +0900 Subject: [PATCH] Use npm link on Cloudflare CI. --- .github/workflows/ci_cloudflare.yml | 56 +++++--------------- x/core/test/runtimes/cloudflare/package.json | 2 +- 2 files changed, 15 insertions(+), 43 deletions(-) diff --git a/.github/workflows/ci_cloudflare.yml b/.github/workflows/ci_cloudflare.yml index 267a75ffa..9868337a1 100644 --- a/.github/workflows/ci_cloudflare.yml +++ b/.github/workflows/ci_cloudflare.yml @@ -22,93 +22,65 @@ jobs: node-version: v20.x - name: Install esbuild run: npm install -g esbuild - - name: Prepare test for ./x/core - working-directory: ./x/core - run: deno task dnt - - name: Run npm pack for ./x/core - working-directory: ./npm-packages/x/core - run: npm pack + - name: Prepare test + run: deno task npm - name: Run test for ./x/core working-directory: ./x/core/test/runtimes/cloudflare run: | + npm link @hpke/core npm install nohup npm start & sleep 3 deno test core.spec.ts --allow-net --config ../../../deno.json - - name: Prepare test for ./x/chacha20poly1305 - working-directory: ./x/chacha20poly1305 - run: deno task dnt - - name: Run npm pack for ./x/chacha20poly1305 - working-directory: ./npm-packages/x/chacha20poly1305 - run: npm pack - name: Run test for ./x/chacha20poly1305 working-directory: ./x/chacha20poly1305/test/runtimes/cloudflare run: | + npm link @hpke/core + npm link @hpke/chacha20poly1305 npm install nohup npm start & sleep 3 deno test chacha20poly1305.spec.ts --allow-net --config ../../../deno.json - - name: Prepare test for ./x/dhkem-x25519 - working-directory: ./x/dhkem-x25519 - run: deno task dnt - - name: Run npm pack for ./x/dhkem-x25519 - working-directory: ./npm-packages/x/dhkem-x25519 - run: npm pack - name: Run test for ./x/dhkem-x25519 working-directory: ./x/dhkem-x25519/test/runtimes/cloudflare run: | + npm link @hpke/core + npm link @hpke/dhkem-x25519 npm install nohup npm start & sleep 3 deno test dhkem-x25519.spec.ts --allow-net --config ../../../deno.json - - name: Prepare test for ./x/dhkem-x448 - working-directory: ./x/dhkem-x448 - run: deno task dnt - - name: Run npm pack for ./x/dhkem-x448 - working-directory: ./npm-packages/x/dhkem-x448 - run: npm pack - name: Run test for ./x/dhkem-x448 working-directory: ./x/dhkem-x448/test/runtimes/cloudflare run: | + npm link @hpke/core + npm link @hpke/dhkem-x448 npm install nohup npm start & sleep 3 deno test dhkem-x448.spec.ts --allow-net --config ../../../deno.json - - name: Prepare test for ./x/dhkem-secp256k1 - working-directory: ./x/dhkem-secp256k1 - run: deno task dnt - - name: Run npm pack for ./x/dhkem-secp256k1 - working-directory: ./npm-packages/x/dhkem-secp256k1 - run: npm pack - name: Run test for ./x/dhkem-secp256k1 working-directory: ./x/dhkem-secp256k1/test/runtimes/cloudflare run: | + npm link @hpke/core + npm link @hpke/dhkem-secp256k1 npm install nohup npm start & sleep 3 deno test dhkem-secp256k1.spec.ts --allow-net --config ../../../deno.json - - name: Prepare test for ./x/hybridkem-x25519-kyber768 - working-directory: ./x/hybridkem-x25519-kyber768 - run: deno task dnt - - name: Run npm pack for ./x/hybridkem-x25519-kyber768 - working-directory: ./npm-packages/x/hybridkem-x25519-kyber768 - run: npm pack - name: Run test for ./x/hybridkem-x25519-kyber768 working-directory: ./x/hybridkem-x25519-kyber768/test/runtimes/cloudflare run: | + npm link @hpke/core + npm link @hpke/hybridkem-x25519-kyber768 npm install nohup npm start & sleep 3 deno test hybridkem-x25519-kyber768.spec.ts --allow-net --config ../../../deno.json - - name: Prepare test for hpke-js - working-directory: ./x/hpke-js - run: deno run -A dnt.ts - - name: Run npm pack for ./x/hpke-js - working-directory: ./npm-packages/x/hpke-js - run: npm pack - name: Run test for ./x/hpke-js working-directory: ./x/hpke-js/test/runtimes/cloudflare run: | + npm link hpke-js npm install nohup npm start & sleep 3 diff --git a/x/core/test/runtimes/cloudflare/package.json b/x/core/test/runtimes/cloudflare/package.json index 8c7a52753..c1a1bdc37 100644 --- a/x/core/test/runtimes/cloudflare/package.json +++ b/x/core/test/runtimes/cloudflare/package.json @@ -10,6 +10,6 @@ "deploy": "wrangler publish" }, "dependencies": { - "@hpke/core": "file:../../../../../npm-packages/x/core/hpke-core-1.3.0.tgz" + "@hpke/core": "^1.3.0" } }