Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add generator steps for bluetooth #2585

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading