Merge pull request #329 from dajiaji/add-samples-deno-for-chacha20pol… #558
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: bun CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
bun-version: [0.6.x, 0.7.x, 0.8.x, 1.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: v20.x | |
- uses: antongolub/action-setup-bun@v1 | |
with: | |
bun-version: ${{ matrix.bun-version }} | |
- name: Install esbuild | |
run: npm install -g esbuild | |
- name: Prepare test for hpke-js | |
working-directory: ./ | |
run: | | |
pwd | |
deno run -A dnt.ts 0.0.0 | |
deno task minify > test/runtimes/hpke.js | |
- name: Run npm pack for hpke-js | |
working-directory: ./npm | |
run: npm pack | |
- name: Prepare test for core | |
working-directory: ./core | |
run: | | |
deno run -A dnt.ts 0.0.0 | |
deno task minify > ../x/dhkem-x25519/test/runtimes/hpke-core.js | |
deno task minify > ../x/dhkem-x448/test/runtimes/hpke-core.js | |
deno task minify > ../x/hybridkem-x25519-kyber768/test/runtimes/hpke-core.js | |
deno task minify > ../x/dhkem-secp256k1/test/runtimes/hpke-core.js | |
- name: Run npm pack for core | |
working-directory: ./core/npm | |
run: npm pack | |
- name: Run test for core | |
working-directory: ./core/test/runtimes/bun | |
run: | | |
bun install | |
nohup bun src/index.ts & | |
sleep 3 | |
deno test core.spec.ts --allow-net --config ../../../deno.json | |
- name: Run test for hpke-js | |
working-directory: ./test/runtimes/bun | |
run: | | |
bun install | |
nohup bun run src/index.ts & | |
sleep 3 | |
deno test hpke.spec.ts --allow-net --config ../../../deno.json | |
- working-directory: ./x/dhkem-x25519 | |
run: | | |
deno task dnt | |
deno task minify > test/runtimes/hpke-dhkem-x25519.js | |
- name: Run test for dhkem-x25519 | |
working-directory: ./x/dhkem-x25519/test/runtimes/bun | |
run: | | |
nohup bun src/index.js & | |
sleep 3 | |
deno test dhkem-x25519.spec.ts --allow-net | |
- working-directory: ./x/dhkem-x448 | |
run: | | |
deno task dnt | |
deno task minify > test/runtimes/hpke-dhkem-x448.js | |
- name: Run test for dhkem-x448 | |
working-directory: ./x/dhkem-x448/test/runtimes/bun | |
run: | | |
nohup bun src/index.js & | |
sleep 3 | |
deno test dhkem-x448.spec.ts --allow-net | |
- working-directory: ./x/chacha20poly1305 | |
run: | | |
deno task dnt | |
deno run -A dnt.ts 0.0.0 | |
- name: Run npm pack for chacha20poly1305 | |
working-directory: ./x/chacha20poly1305/npm | |
run: npm pack | |
- name: Run test for chacha20poly1305 | |
working-directory: ./x/chacha20poly1305/test/runtimes/bun | |
run: | | |
bun install | |
nohup bun src/index.ts & | |
sleep 3 | |
deno test chacha20poly1305.spec.ts --allow-net --config ../../../deno.json | |
- working-directory: ./x/hybridkem-x25519-kyber768 | |
run: | | |
deno task dnt | |
deno task minify > test/runtimes/hpke-hybridkem-x25519-kyber768.js | |
- name: Run test for hybridkem-x25519-kyber768 | |
working-directory: ./x/hybridkem-x25519-kyber768/test/runtimes/bun | |
run: | | |
nohup bun src/index.js & | |
sleep 3 | |
deno test hybridkem-x25519-kyber768.spec.ts --allow-net | |
- working-directory: ./x/dhkem-secp256k1/ | |
run: | | |
deno task dnt | |
deno task minify > test/runtimes/hpke-dhkem-secp256k1.js | |
- name: Run test for dhkem-secp256k1 | |
working-directory: ./x/dhkem-secp256k1/test/runtimes/bun | |
run: | | |
nohup bun src/index.js & | |
sleep 3 | |
deno test dhkem-secp256k1.spec.ts --allow-net |