Skip to content

Commit bad6237

Browse files
committed
Add a build step and TS typetest matrix to the existing workflow
1 parent dda6f1a commit bad6237

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

.github/workflows/test.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,38 @@ jobs:
3535

3636
- name: Run test suite
3737
run: npm test
38+
39+
- name: Check build
40+
run: npm run build
41+
42+
test-types:
43+
name: Test Types with TypeScript ${{ matrix.ts }}
44+
45+
needs: [build]
46+
runs-on: ubuntu-latest
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
node: ['16.x']
51+
ts: ['4.1', '4.2', '4.3', '4.4', '4.5', '4.6', '4.7', '4.8', '4.9.2-rc']
52+
steps:
53+
- name: Checkout repo
54+
uses: actions/checkout@v2
55+
56+
- name: Use node ${{ matrix.node }}
57+
uses: actions/setup-node@v2
58+
with:
59+
node-version: ${{ matrix.node }}
60+
cache: 'npm'
61+
62+
- name: Install dependencies
63+
run: npm ci
64+
65+
- name: Install TypeScript ${{ matrix.ts }}
66+
run: npm i --save-dev typescript@${{ matrix.ts }}
67+
68+
- name: Test types
69+
run: |
70+
npm run tsc -- --version
71+
npm run check-types
72+
npm run test:types

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
"build": "rollup -c",
5656
"prepublishOnly": "npm run clean && npm run check-types && npm run format:check && npm run lint && npm test",
5757
"examples:lint": "eslint --ext js,ts examples",
58-
"examples:test": "cross-env CI=true babel-node examples/testAll.js"
58+
"examples:test": "cross-env CI=true babel-node examples/testAll.js",
59+
"tsc": "tsc"
5960
},
6061
"dependencies": {},
6162
"devDependencies": {

0 commit comments

Comments
 (0)