Skip to content

Commit

Permalink
build: add generator steps for bluetooth
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Sep 5, 2024
1 parent 764fab5 commit c6fe98b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/update-bidi-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ jobs:
repository: w3c/permissions
ref: main
path: permissions
- name: Check out w3c/permissions spec repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: WebBluetoothCG/web-bluetooth
ref: main
path: web-bluetooth
- name: Generate WebDriverBidi CDDL
run: ./scripts/test.sh
working-directory: webdriver-bidi
Expand All @@ -55,6 +61,14 @@ jobs:
with:
name: permissions-cddl
path: permissions/permissions.cddl
- name: Generate WebDriverBidi CDDL for web-bluetooth
run: ../webdriver-bidi/scripts/cddl/generate.js ./index.bs && mv all.cddl web-bluetooth.cddl
working-directory: web-bluetooth
- name: Upload WebDriverBidi CDDL for Permissions
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: web-bluetooth-cddl
path: web-bluetooth/web-bluetooth.cddl

pr:
name: Send PR
Expand Down Expand Up @@ -90,10 +104,16 @@ jobs:
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: permissions-cddl
- name: Download WebDriverBidi CDDL for web-bluetooth
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: web-bluetooth-cddl
- name: Generate TypeScript types for the main spec
run: node tools/generate-bidi-types.mjs --cddl-file all.cddl
- name: Generate TypeScript types for Permissions spec
run: node tools/generate-bidi-types.mjs --cddl-file permissions.cddl --ts-file src/protocol/generated/webdriver-bidi-permissions.ts --zod-file src/protocol-parser/generated/webdriver-bidi-permissions.ts
- name: Generate TypeScript types for web-bluetooth spec
run: node tools/generate-bidi-types.mjs --cddl-file web-bluetooth.cddl --ts-file src/protocol/generated/webdriver-bidi-bluetooth.ts --zod-file src/protocol-parser/generated/webdriver-bidi-bluetooth.ts
- run: git diff
# Needed for `npm run format`.
- run: python -m pip install pre-commit
Expand Down

0 comments on commit c6fe98b

Please sign in to comment.