Skip to content

Commit

Permalink
Update browser CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
dajiaji committed Aug 24, 2024
1 parent a57fb83 commit b06671d
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 43 deletions.
80 changes: 45 additions & 35 deletions .github/workflows/ci_browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,60 +20,70 @@ 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 }}
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
10 changes: 3 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@
"allowImportingTsExtensions": true
},
"include": [
"core/**/*",
"mod.ts",
"src/**/*"
"x/**/*"
],
"exclude": [
"core/dnt.ts",
"core/samples/**/*",
"core/test/**/*",
"src/test/**/*"
"x/**/samples/**/*",
"x/**/test/**/*"
]
}
6 changes: 5 additions & 1 deletion x/hpke-js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
"module": "es2022",
"target": "es2022",
"paths": {
"@hpke/core": ["../../core/mod.ts"]
"@hpke/core": "../core/mod.ts",
"@hpke/chacha20poly1305": "../chacha20poly1305/mod.ts",
"@hpke/dhkem-x25519": "../dhkem-x25519/mod.ts",
"@hpke/dhkem-x448": "../dhkem-x448/mod.ts",

},
"allowImportingTsExtensions": true
},
Expand Down

0 comments on commit b06671d

Please sign in to comment.