Skip to content

Commit

Permalink
Merge pull request #338 from dajiaji/introduce-deno-workspace
Browse files Browse the repository at this point in the history
Introduce deno workspace.
  • Loading branch information
dajiaji authored Aug 24, 2024
2 parents 2731fe4 + 68da33f commit 5053626
Show file tree
Hide file tree
Showing 203 changed files with 2,011 additions and 2,255 deletions.
60 changes: 30 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,33 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.lcov
flags: unittests
- name: Run deno test for /core
working-directory: ./core
run: |
deno fmt --check
deno task test
- name: Run deno test for /x/dhkem-x25519
working-directory: ./x/dhkem-x25519
run: |
deno fmt --check
deno task test
- name: Run deno test for /x/dhkem-x448
working-directory: ./x/dhkem-x448
run: |
deno fmt --check
deno task test
- name: Run deno test for /x/chacha20poly1305
working-directory: ./x/chacha20poly1305
run: |
deno fmt --check
deno task test
- name: Run deno test for /x/hybridkem-x25519-kyber768
working-directory: ./x/hybridkem-x25519-kyber768
run: |
deno fmt --check
deno task test
- name: Run deno test for /x/dhkem-secp256k1
working-directory: ./x/dhkem-secp256k1
run: |
deno fmt --check
deno task test
# - name: Run deno test for /core
# working-directory: ./core
# run: |
# deno fmt --check
# deno task test
# - name: Run deno test for /x/dhkem-x25519
# working-directory: ./x/dhkem-x25519
# run: |
# deno fmt --check
# deno task test
# - name: Run deno test for /x/dhkem-x448
# working-directory: ./x/dhkem-x448
# run: |
# deno fmt --check
# deno task test
# - name: Run deno test for /x/chacha20poly1305
# working-directory: ./x/chacha20poly1305
# run: |
# deno fmt --check
# deno task test
# - name: Run deno test for /x/hybridkem-x25519-kyber768
# working-directory: ./x/hybridkem-x25519-kyber768
# run: |
# deno fmt --check
# deno task test
# - name: Run deno test for /x/dhkem-secp256k1
# working-directory: ./x/dhkem-secp256k1
# run: |
# deno fmt --check
# deno task test
82 changes: 46 additions & 36 deletions .github/workflows/ci_browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,64 +20,74 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: v18.x
- run: |
- name: Install dependencies
run: |
npm install -g typescript
npm install -g typedoc
npx typedoc --name "hpke-js $(git describe --tags --abbrev=0)" --out test/runtimes/browsers/pages/docs mod.ts
npm install -g esbuild
- name: Build docs for @hpke/hpke-js
working-directory: ./x/hpke-js
run: |
npx typedoc --name "@hpke/hpke-js $(git describe --tags --abbrev=0)" --out test/runtimes/browsers/pages/docs mod.ts
deno task dnt
deno task minify > test/runtimes/browsers/pages/src/hpke.js
mkdir test/runtimes/browsers/pages/core
cp -rf core/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/core
cp -rf ../core/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/core
mkdir test/runtimes/browsers/pages/chacha20poly1305
cp -rf ../chacha20poly1305/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/chacha20poly1305
mkdir test/runtimes/browsers/pages/dhkem-x25519
cp -rf x/dhkem-x25519/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/dhkem-x25519
cp -rf ../dhkem-x25519/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/dhkem-x25519
mkdir test/runtimes/browsers/pages/dhkem-x448
cp -rf x/dhkem-x448/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/dhkem-x448
mkdir test/runtimes/browsers/pages/chacha20poly1305
cp -rf x/chacha20poly1305/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/chacha20poly1305
cp -rf ../dhkem-x448/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/dhkem-x448
mkdir test/runtimes/browsers/pages/hybridkem-x25519-kyber768
cp -rf x/hybridkem-x25519-kyber768/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/hybridkem-x25519-kyber768
cp -rf ../hybridkem-x25519-kyber768/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/hybridkem-x25519-kyber768
mkdir test/runtimes/browsers/pages/dhkem-secp256k1
cp -rf x/dhkem-secp256k1/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/dhkem-secp256k1
- working-directory: ./core
cp -rf ../dhkem-secp256k1/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/dhkem-secp256k1
- name: Build docs for @hpke/core
working-directory: ./x/core
run: |
npx typedoc --name "@hpke/core $(git describe --tags --abbrev=0)" --out ../test/runtimes/browsers/pages/core/docs mod.ts
npx typedoc --name "@hpke/core $(git describe --tags --abbrev=0)" --out ../hpke-js/test/runtimes/browsers/pages/core/docs mod.ts
deno task dnt
deno task minify > ../test/runtimes/browsers/pages/core/src/hpke-core.js
deno task minify > ../test/runtimes/browsers/pages/dhkem-x25519/src/hpke-core.js
deno task minify > ../test/runtimes/browsers/pages/dhkem-x448/src/hpke-core.js
deno task minify > ../test/runtimes/browsers/pages/chacha20poly1305/src/hpke-core.js
deno task minify > ../test/runtimes/browsers/pages/hybridkem-x25519-kyber768/src/hpke-core.js
deno task minify > ../test/runtimes/browsers/pages/dhkem-secp256k1/src/hpke-core.js
- working-directory: ./x/dhkem-x25519
deno task minify > ../hpke-js/test/runtimes/browsers/pages/core/src/hpke-core.js
deno task minify > ../hpke-js/test/runtimes/browsers/pages/dhkem-x25519/src/hpke-core.js
deno task minify > ../hpke-js/test/runtimes/browsers/pages/dhkem-x448/src/hpke-core.js
deno task minify > ../hpke-js/test/runtimes/browsers/pages/chacha20poly1305/src/hpke-core.js
deno task minify > ../hpke-js/test/runtimes/browsers/pages/hybridkem-x25519-kyber768/src/hpke-core.js
deno task minify > ../hpke-js/test/runtimes/browsers/pages/dhkem-secp256k1/src/hpke-core.js
- name: Build docs for @hpke/chacha20poly1305
working-directory: ./x/chacha20poly1305
run: |
npx typedoc --name "@hpke/dhkem-x25519 $(git describe --tags --abbrev=0)" --out ../../test/runtimes/browsers/pages/dhkem-x25519/docs mod.ts
npx typedoc --name "@hpke/chacha20poly1305 $(git describe --tags --abbrev=0)" --out ../hpke-js/test/runtimes/browsers/pages/chacha20poly1305/docs mod.ts
deno task dnt
deno task minify > ../../test/runtimes/browsers/pages/dhkem-x25519/src/hpke-dhkem-x25519.js
- working-directory: ./x/dhkem-x448
deno task minify > ../hpke-js/test/runtimes/browsers/pages/chacha20poly1305/src/hpke-chacha20poly1305.js
- name: Build docs for @hpke/dhkem-x25519
working-directory: ./x/dhkem-x25519
run: |
npx typedoc --name "@hpke/dhkem-x448 $(git describe --tags --abbrev=0)" --out ../../test/runtimes/browsers/pages/dhkem-x448/docs mod.ts
npx typedoc --name "@hpke/dhkem-x25519 $(git describe --tags --abbrev=0)" --out ../hpke-js/test/runtimes/browsers/pages/dhkem-x25519/docs mod.ts
deno task dnt
deno task minify > ../../test/runtimes/browsers/pages/dhkem-x448/src/hpke-dhkem-x448.js
- working-directory: ./x/chacha20poly1305
deno task minify > ../hpke-js/test/runtimes/browsers/pages/dhkem-x25519/src/hpke-dhkem-x25519.js
- name: Build docs for @hpke/dhkem-x448
working-directory: ./x/dhkem-x448
run: |
npx typedoc --name "@hpke/chacha20poly1305 $(git describe --tags --abbrev=0)" --out ../../test/runtimes/browsers/pages/chacha20poly1305/docs mod.ts
npx typedoc --name "@hpke/dhkem-x448 $(git describe --tags --abbrev=0)" --out ../hpke-js/test/runtimes/browsers/pages/dhkem-x448/docs mod.ts
deno task dnt
deno task minify > ../../test/runtimes/browsers/pages/chacha20poly1305/src/hpke-chacha20poly1305.js
- working-directory: ./x/hybridkem-x25519-kyber768
deno task minify > ../hpke-js/test/runtimes/browsers/pages/dhkem-x448/src/hpke-dhkem-x448.js
- name: Build docs for @hpke/hybridkem-x25519-kyber768
working-directory: ./x/hybridkem-x25519-kyber768
run: |
npx typedoc --name "@hpke/hybridkem-x25519-kyber768 $(git describe --tags --abbrev=0)" --out ../../test/runtimes/browsers/pages/hybridkem-x25519-kyber768/docs mod.ts
npx typedoc --name "@hpke/hybridkem-x25519-kyber768 $(git describe --tags --abbrev=0)" --out ../hpke-js/test/runtimes/browsers/pages/hybridkem-x25519-kyber768/docs mod.ts
deno task dnt
deno task minify > ../../test/runtimes/browsers/pages/hybridkem-x25519-kyber768/src/hpke-hybridkem-x25519-kyber768.js
- working-directory: ./x/dhkem-secp256k1
deno task minify > ../hpke-js/test/runtimes/browsers/pages/hybridkem-x25519-kyber768/src/hpke-hybridkem-x25519-kyber768.js
- name: Build docs for @hpke/dhkem-secp256k1
working-directory: ./x/dhkem-secp256k1
run: |
npx typedoc --name "@hpke/dhkem-secp256k1 $(git describe --tags --abbrev=0)" --out ../../test/runtimes/browsers/pages/dhkem-secp256k1/docs mod.ts
npx typedoc --name "@hpke/dhkem-secp256k1 $(git describe --tags --abbrev=0)" --out ../hpke-js/test/runtimes/browsers/pages/dhkem-secp256k1/docs mod.ts
deno task dnt
deno task minify > ../../test/runtimes/browsers/pages/dhkem-secp256k1/src/hpke-dhkem-secp256k1.js
deno task minify > ../hpke-js/test/runtimes/browsers/pages/dhkem-secp256k1/src/hpke-dhkem-secp256k1.js
- uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./test/runtimes/browsers/pages
publish_dir: ./x/hpke-js/test/runtimes/browsers/pages

playwright-test:
needs: pages
Expand All @@ -86,9 +96,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: microsoft/playwright-github-action@v1
- working-directory: ./test/runtimes/browsers
run: npm install && npx playwright install && npx playwright test
- working-directory: ./core/test/runtimes/browsers
- working-directory: ./x/core/test/runtimes/browsers
run: npm install && npx playwright install && npx playwright test
- working-directory: ./x/dhkem-x25519/test/runtimes/browsers
run: npm install && npx playwright install && npx playwright test
Expand All @@ -100,3 +108,5 @@ jobs:
run: npm install && npx playwright install && npx playwright test
- working-directory: ./x/dhkem-secp256k1/test/runtimes/browsers
run: npm install && npx playwright install && npx playwright test
- working-directory: ./x/hpke-js/test/runtimes/browsers
run: npm install && npx playwright install && npx playwright test
95 changes: 49 additions & 46 deletions .github/workflows/ci_bun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,91 +30,94 @@ jobs:
bun-version: ${{ matrix.bun-version }}
- name: Install esbuild
run: npm install -g esbuild
- name: Prepare test for hpke-js
working-directory: ./
- name: Prepare test for ./x/core
working-directory: ./x/core
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
deno task minify > ../dhkem-x25519/test/runtimes/hpke-core.js
deno task minify > ../dhkem-x448/test/runtimes/hpke-core.js
deno task minify > ../hybridkem-x25519-kyber768/test/runtimes/hpke-core.js
deno task minify > ../dhkem-secp256k1/test/runtimes/hpke-core.js
- name: Run npm pack for ./x/core
working-directory: ./npm-packages/x/core
run: npm pack
- name: Run test for core
working-directory: ./core/test/runtimes/bun
- 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: Run test for hpke-js
working-directory: ./test/runtimes/bun
- name: Prepare test for ./x/chacha20poly1305
working-directory: ./x/chacha20poly1305
run: |
deno run -A dnt.ts 0.0.0
- 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 run src/index.ts &
nohup bun src/index.ts &
sleep 3
deno test hpke.spec.ts --allow-net --config ../../../deno.json
- working-directory: ./x/dhkem-x25519
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
deno task minify > test/runtimes/hpke-dhkem-x25519.js
- name: Run test for dhkem-x25519
- name: Run test for ./x/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
- name: Prepare test for ./x/dhkem-x448
working-directory: ./x/dhkem-x448
run: |
deno task dnt
deno task minify > test/runtimes/hpke-dhkem-x448.js
- name: Run test for dhkem-x448
- name: Run test for ./x/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
- name: Prepare test for ./x/hybridkem-x25519-kyber768
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
- name: Run test for ./x/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/
- name: Prepare test for ./x/dhkem-secp256k1
working-directory: ./x/dhkem-secp256k1
run: |
deno task dnt
deno task minify > test/runtimes/hpke-dhkem-secp256k1.js
- name: Run test for dhkem-secp256k1
- name: Run test for ./x/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
deno test dhkem-secp256k1.spec.ts --allow-net
- name: Prepare test for ./x/hpke-js
working-directory: ./x/hpke-js
run: |
deno run -A dnt.ts 0.0.0
deno task minify > test/runtimes/hpke.js
- 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: |
bun install
nohup bun run src/index.ts &
sleep 3
deno test hpke.spec.ts --allow-net --config ../../../deno.json
Loading

0 comments on commit 5053626

Please sign in to comment.