Skip to content

Commit 5b38cb1

Browse files
Use TypeScript to verify CLI reference output (#4311)
1 parent c345cc8 commit 5b38cb1

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.github/workflows/main.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- run: rustup update --no-self-update stable && rustup default stable
3030
- run: rustup component add rustfmt
3131
- run: cargo fmt --all -- --check
32-
32+
3333
# Check TOML style by using Taplo.
3434
taplo:
3535
name: Taplo
@@ -240,6 +240,22 @@ jobs:
240240
# WBINDGEN_I_PROMISE_JS_SYNTAX_WORKS_IN_NODE: 1
241241
# - run: cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features "Node Window Document"
242242

243+
# This checks that the output of the CLI is actually valid JavaScript and TypeScript
244+
test_cli_reference_typescript:
245+
name: Run CLI reference TypeScript check
246+
runs-on: ubuntu-latest
247+
steps:
248+
- uses: actions/checkout@v4
249+
- uses: actions/setup-node@v4
250+
with:
251+
node-version: 'lts/*'
252+
- run: npm i -g typescript
253+
- run: npm i --save @types/node @types/deno
254+
- name: Check TypeScript output
255+
run: tsc --noEmit --skipLibCheck --lib esnext,dom $(echo crates/cli/tests/reference/*.d.ts)
256+
- name: Check JavaScript output
257+
run: tsc --noEmit --skipLibCheck --lib esnext,dom --module esnext --allowJs $(echo crates/cli/tests/reference/*.js)
258+
243259
test_native:
244260
name: Run native tests
245261
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)