Skip to content

Commit

Permalink
Merge pull request #376 from dajiaji/add-bun-link
Browse files Browse the repository at this point in the history
Use bun link.
  • Loading branch information
dajiaji authored Sep 1, 2024
2 parents 6ce81e7 + 4dc967d commit 092b7ad
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 55 deletions.
46 changes: 4 additions & 42 deletions .github/workflows/ci_bun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,90 +30,52 @@ jobs:
bun-version: latest
- 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
deno task bun-link
- name: Run test for ./x/core
working-directory: ./x/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: 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/bun
run: |
bun install
nohup bun src/index.ts &
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/bun
run: |
bun install
nohup bun src/index.ts &
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/bun
run: |
bun install
nohup bun src/index.ts &
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/bun
run: |
bun install
nohup bun src/index.ts &
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/bun
run: |
bun install
nohup bun src/index.ts &
sleep 3
deno test hybridkem-x25519-kyber768.spec.ts --allow-net --config ../../../deno.json
- name: Prepare test for ./x/hpke-js
working-directory: ./x/hpke-js
run: deno task dnt
- 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/bun
run: |
Expand Down
9 changes: 8 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@
"npm-pack:dhkem-secp256k1": "cd npm-packages/x/dhkem-secp256k1 && npm pack --dry-run",
"npm-pack:hybridkem-x25519-kyber768": "cd npm-packages/x/hybridkem-x25519-kyber768 && npm pack --dry-run",
"npm-pack:hpke-js": "cd npm-packages/x/hpke-js && npm pack --dry-run",
"minify": "esbuild npm/esm/mod.js --bundle --format=esm --minify"
"bun-link": "deno task bun-link:core && deno task bun-link:chacha20poly1305 && deno task bun-link:dhkem-x25519 && deno task bun-link:dhkem-x448 && deno task bun-link:dhkem-secp256k1 && deno task bun-link:hybridkem-x25519-kyber768 && deno task bun-link:hpke-js",
"bun-link:core": "cd npm-packages/x/core && bun link",
"bun-link:chacha20poly1305": "cd npm-packages/x/chacha20poly1305 && bun link",
"bun-link:dhkem-x25519": "cd npm-packages/x/dhkem-x25519 && bun link",
"bun-link:dhkem-x448": "cd npm-packages/x/dhkem-x448 && bun link",
"bun-link:dhkem-secp256k1": "cd npm-packages/x/dhkem-secp256k1 && bun link",
"bun-link:hybridkem-x25519-kyber768": "cd npm-packages/x/hybridkem-x25519-kyber768 && bun link",
"bun-link:hpke-js": "cd npm-packages/x/hpke-js && bun link"
}
}
Binary file modified x/chacha20poly1305/test/runtimes/bun/bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions x/chacha20poly1305/test/runtimes/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"typescript": "^5.0.0"
},
"dependencies": {
"@hpke/chacha20poly1305": "^1.3.0",
"@hpke/core": "^1.3.0"
"@hpke/chacha20poly1305": "link:@hpke/chacha20poly1305",
"@hpke/core": "link:@hpke/core"
}
}
Binary file modified x/core/test/runtimes/bun/bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion x/core/test/runtimes/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"typescript": "^5.0.0"
},
"dependencies": {
"@hpke/core": "^1.3.0"
"@hpke/core": "link:@hpke/core"
}
}
Binary file modified x/dhkem-secp256k1/test/runtimes/bun/bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions x/dhkem-secp256k1/test/runtimes/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"typescript": "^5.0.0"
},
"dependencies": {
"@hpke/core": "^1.3.0",
"@hpke/dhkem-secp256k1": "^1.3.0"
"@hpke/core": "link:@hpke/core",
"@hpke/dhkem-secp256k1": "link:@hpke/dhkem-secp256k1"
}
}
Binary file modified x/dhkem-x25519/test/runtimes/bun/bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions x/dhkem-x25519/test/runtimes/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"typescript": "^5.0.0"
},
"dependencies": {
"@hpke/core": "^1.3.0",
"@hpke/dhkem-x25519": "^1.3.0"
"@hpke/core": "link:@hpke/core",
"@hpke/dhkem-x25519": "link:@hpke/dhkem-x25519"
}
}
Binary file modified x/dhkem-x448/test/runtimes/bun/bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions x/dhkem-x448/test/runtimes/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"typescript": "^5.0.0"
},
"dependencies": {
"@hpke/core": "^1.3.0",
"@hpke/dhkem-x448": "^1.3.0"
"@hpke/core": "link:@hpke/core",
"@hpke/dhkem-x448": "link:@hpke/dhkem-x448"
}
}
Binary file modified x/hpke-js/test/runtimes/bun/bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion x/hpke-js/test/runtimes/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"typescript": "^5.0.0"
},
"dependencies": {
"hpke-js": "^1.3.0"
"hpke-js": "link:hpke-js"
}
}
Binary file modified x/hybridkem-x25519-kyber768/test/runtimes/bun/bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions x/hybridkem-x25519-kyber768/test/runtimes/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"typescript": "^5.0.0"
},
"dependencies": {
"@hpke/core": "^1.3.0",
"@hpke/hybridkem-x25519-kyber768": "^1.3.0"
"@hpke/core": "link:@hpke/core",
"@hpke/hybridkem-x25519-kyber768": "link:@hpke/hybridkem-x25519-kyber768"
}
}

0 comments on commit 092b7ad

Please sign in to comment.