23
23
type : string
24
24
25
25
jobs :
26
- build :
27
- name : Build WebDriverBiDi types
26
+ build_main_spec :
27
+ name : Build main spec cddl types
28
28
runs-on : ubuntu-latest
29
29
steps :
30
+ - name : Install dependencies
31
+ run : |
32
+
33
+ npm install parse5
30
34
- name : Check out the main spec repository
31
35
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
32
36
with :
33
37
repository : ${{ github.event.inputs.repository || 'w3c/webdriver-bidi' }}
34
38
ref : ${{ github.event.inputs.source_ref || 'main' }}
35
39
path : webdriver-bidi
36
- - name : Check out w3c/permissions spec repository
37
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38
- with :
39
- repository : w3c/permissions
40
- ref : main
41
- path : permissions
42
- - name : Check out w3c/permissions spec repository
43
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44
- with :
45
- repository : WebBluetoothCG/web-bluetooth
46
- ref : main
47
- path : web-bluetooth
48
40
- name : Generate WebDriverBidi CDDL
49
41
run : ./scripts/test.sh
50
42
working-directory : webdriver-bidi
53
45
with :
54
46
name : all-cddl
55
47
path : webdriver-bidi/all.cddl
48
+
49
+ build_permissions :
50
+ name : Build Permissions CDDL
51
+ runs-on : ubuntu-latest
52
+ steps :
53
+ - name : Install dependencies
54
+ run : |
55
+
56
+ npm install parse5
57
+ - name : Check out the main spec repository
58
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
59
+ with :
60
+ repository : ${{ github.event.inputs.repository || 'w3c/webdriver-bidi' }}
61
+ ref : ${{ github.event.inputs.source_ref || 'main' }}
62
+ path : webdriver-bidi
63
+ - name : Check out w3c/permissions spec repository
64
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
65
+ with :
66
+ repository : w3c/permissions
67
+ ref : main
68
+ path : permissions
56
69
- name : Generate WebDriverBidi CDDL for Permissions
57
70
run : ../webdriver-bidi/scripts/cddl/generate.js ./index.html && mv all.cddl permissions.cddl
58
71
working-directory : permissions
@@ -61,18 +74,41 @@ jobs:
61
74
with :
62
75
name : permissions-cddl
63
76
path : permissions/permissions.cddl
77
+
78
+ build_bluetooth_cddl :
79
+ name : Build Bluetooth CDDL
80
+ runs-on : ubuntu-latest
81
+ steps :
82
+ - name : Install dependencies
83
+ run : |
84
+
85
+ npm install parse5
86
+ - name : Check out the main spec repository
87
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
88
+ with :
89
+ repository : ${{ github.event.inputs.repository || 'w3c/webdriver-bidi' }}
90
+ ref : ${{ github.event.inputs.source_ref || 'main' }}
91
+ path : webdriver-bidi
92
+ - name : Check out WebBluetoothCG/web-bluetooth spec repository
93
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
94
+ with :
95
+ repository : WebBluetoothCG/web-bluetooth
96
+ ref : main
97
+ path : web-bluetooth
64
98
- name : Generate WebDriverBidi CDDL for web-bluetooth
65
99
run : ../webdriver-bidi/scripts/cddl/generate.js ./index.bs && mv all.cddl web-bluetooth.cddl
66
100
working-directory : web-bluetooth
67
- - name : Upload WebDriverBidi CDDL for Permissions
101
+ - name : Upload WebDriverBidi CDDL for web-bluetooth
68
102
uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
69
103
with :
70
104
name : web-bluetooth-cddl
71
105
path : web-bluetooth/web-bluetooth.cddl
72
106
73
107
pr :
74
108
name : Send PR
75
- needs : build
109
+ needs : [build_main_spec, build_permissions, build_bluetooth_cddl]
110
+ # Run even if some CDDL's are not built.
111
+ if : always()
76
112
runs-on : ubuntu-latest
77
113
steps :
78
114
- name : Check out mapper repository
@@ -100,20 +136,32 @@ jobs:
100
136
uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
101
137
with :
102
138
name : all-cddl
139
+ # Tolerate missing files.
140
+ continue-on-error : true
103
141
- name : Download WebDriverBidi CDDL for Permissions
104
142
uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
105
143
with :
106
144
name : permissions-cddl
145
+ # Tolerate missing files.
146
+ continue-on-error : true
107
147
- name : Download WebDriverBidi CDDL for web-bluetooth
108
148
uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
109
149
with :
110
150
name : web-bluetooth-cddl
151
+ # Tolerate missing files.
152
+ continue-on-error : true
111
153
- name : Generate TypeScript types for the main spec
112
154
run : node tools/generate-bidi-types.mjs --cddl-file all.cddl
155
+ # Tolerate errors during generating types.
156
+ continue-on-error : true
113
157
- name : Generate TypeScript types for Permissions spec
114
158
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
159
+ # Tolerate errors during generating types.
160
+ continue-on-error : true
115
161
- name : Generate TypeScript types for web-bluetooth spec
116
162
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
163
+ # Tolerate errors during generating types.
164
+ continue-on-error : true
117
165
- run : git diff
118
166
# Needed for `npm run format`.
119
167
- run : python -m pip install pre-commit
0 commit comments