From c6fe98b0c5433edd200e803f869089f3cc71c684 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Thu, 5 Sep 2024 09:48:11 +0200 Subject: [PATCH] build: add generator steps for bluetooth --- .github/workflows/update-bidi-types.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/update-bidi-types.yml b/.github/workflows/update-bidi-types.yml index d468e3da0b..c5fad2989d 100644 --- a/.github/workflows/update-bidi-types.yml +++ b/.github/workflows/update-bidi-types.yml @@ -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 @@ -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 @@ -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