Skip to content

Commit 128b3e9

Browse files
committed
ci,test: separate type tests
1 parent f5f6ed2 commit 128b3e9

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

.github/workflows/test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,32 @@ jobs:
4343
path: dist
4444
- run: git reset HEAD --hard
4545

46+
typings:
47+
needs:
48+
- build
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Environment Information
52+
run: npx envinfo
53+
- name: Checkout
54+
uses: actions/checkout@v3
55+
- name: Setup node
56+
id: node
57+
uses: actions/setup-node@v3
58+
with:
59+
node-version: lts/hydrogen # 18
60+
cache: 'npm'
61+
- run: npm clean-install
62+
- name: Load cached dist
63+
uses: actions/cache@v3
64+
id: dist
65+
with:
66+
path: dist
67+
key: ${{ needs.build.outputs.cache-key }}
68+
fail-on-cache-miss: true
69+
- name: Check TypeScript type definitions
70+
run: npm run test:types
71+
4672
node:
4773
needs:
4874
- build
@@ -269,6 +295,7 @@ jobs:
269295
- edge-runtime
270296
- electron
271297
- node
298+
- typings
272299
- workers
273300
runs-on: ubuntu-latest
274301
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && github.repository == 'panva/jose' }}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@
125125
"types:find": "find dist/types -name '*.d.ts' -type f -print0",
126126
"runtime:node:copy": "cp ./src/runtime/node/*.ts ./src/runtime",
127127
"runtime:refs": "run-s -s runtime:find | xargs -0 sed -i.bak -e \"s/'\\.\\.\\//'\\.\\//g\" -e \"s/'\\.\\/\\.\\./'../g\" && npm run-script sedcleanup",
128-
"test": "ava && tsd -f test/types",
128+
"test": "ava",
129+
"test:types": "tsd -f test/types",
129130
"format": "prettier --loglevel silent --write ./test ./tap ./src ./tools ./cookbook",
130131
"tap:browsers": "./tap/.browsers.sh",
131132
"tap:bun": "./tap/.bun.sh",

0 commit comments

Comments
 (0)