From e0365052c51f0e2af2591cab3dc157cb4beb8fe8 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Sat, 30 Nov 2024 16:41:46 +0100 Subject: [PATCH 1/5] Use TypeScript to verify CLI reference output --- .github/workflows/main.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b5e9de0542a..a39bde8d74c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,7 +29,7 @@ jobs: - run: rustup update --no-self-update stable && rustup default stable - run: rustup component add rustfmt - run: cargo fmt --all -- --check - + # Check TOML style by using Taplo. taplo: name: Taplo @@ -239,6 +239,24 @@ jobs: # WBINDGEN_I_PROMISE_JS_SYNTAX_WORKS_IN_NODE: 1 # - run: cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features "Node Window Document" + # This checks that the output of the CLI is actually valid JavaScript and TypeScript + test_cli_reference_typescript: + name: Run CLI reference TypeScript check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - run: npm i -g typescript + - run: | + for f in crates/cli/tests/reference/*.d.ts; do + tsc --noEmit $f + done + for f in crates/cli/tests/reference/*.js; do + tsc --noEmit --allowJs --checkJs $f + done + test_native: name: Run native tests runs-on: ubuntu-latest From 1cd620e0bfb6183e371ef140045683aa084ff5e7 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Sat, 30 Nov 2024 17:08:15 +0100 Subject: [PATCH 2/5] Commands should work now --- .github/workflows/main.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a39bde8d74c..eb0a4997346 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -248,14 +248,13 @@ jobs: - uses: actions/setup-node@v4 with: node-version: '20' + - run: cd crates/cli/tests - run: npm i -g typescript - - run: | - for f in crates/cli/tests/reference/*.d.ts; do - tsc --noEmit $f - done - for f in crates/cli/tests/reference/*.js; do - tsc --noEmit --allowJs --checkJs $f - done + - run: npm i --save @types/node @types/deno + - name: Check TypeScript output + run: tsc --noEmit --skipLibCheck --lib esnext,dom $(echo reference/*.d.ts) + - name: Check JavaScript output + run: tsc --noEmit --skipLibCheck --lib esnext,dom --module esnext --allowJs --checkJs $(echo reference/*.js) test_native: name: Run native tests From 49cff7d2acada573923ebe77e4f87b6b867e06bd Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Sat, 30 Nov 2024 17:10:35 +0100 Subject: [PATCH 3/5] No cd --- .github/workflows/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eb0a4997346..014f3407793 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -248,13 +248,12 @@ jobs: - uses: actions/setup-node@v4 with: node-version: '20' - - run: cd crates/cli/tests - run: npm i -g typescript - run: npm i --save @types/node @types/deno - name: Check TypeScript output - run: tsc --noEmit --skipLibCheck --lib esnext,dom $(echo reference/*.d.ts) + run: tsc --noEmit --skipLibCheck --lib esnext,dom $(echo crates/cli/tests/reference/*.d.ts) - name: Check JavaScript output - run: tsc --noEmit --skipLibCheck --lib esnext,dom --module esnext --allowJs --checkJs $(echo reference/*.js) + run: tsc --noEmit --skipLibCheck --lib esnext,dom --module esnext --allowJs --checkJs $(echo crates/cli/tests/reference/*.js) test_native: name: Run native tests From 7d29dc5f38934b8c274106138508f034848eb4d7 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Sat, 30 Nov 2024 17:13:45 +0100 Subject: [PATCH 4/5] No JS check --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 014f3407793..eea89ccad03 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -253,7 +253,7 @@ jobs: - name: Check TypeScript output run: tsc --noEmit --skipLibCheck --lib esnext,dom $(echo crates/cli/tests/reference/*.d.ts) - name: Check JavaScript output - run: tsc --noEmit --skipLibCheck --lib esnext,dom --module esnext --allowJs --checkJs $(echo crates/cli/tests/reference/*.js) + run: tsc --noEmit --skipLibCheck --lib esnext,dom --module esnext --allowJs $(echo crates/cli/tests/reference/*.js) test_native: name: Run native tests From c378d1dc056ad08e24c2d895c6cca25828d3619b Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Sat, 7 Dec 2024 11:02:45 +0100 Subject: [PATCH 5/5] Use latest LTS --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d67e08f0d6d..6909d10dd08 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -248,7 +248,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '20' + node-version: 'lts/*' - run: npm i -g typescript - run: npm i --save @types/node @types/deno - name: Check TypeScript output