Skip to content

Commit

Permalink
Add a build step and TS typetest matrix to the existing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Feb 12, 2023
1 parent dda6f1a commit bad6237
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,38 @@ jobs:

- name: Run test suite
run: npm test

- name: Check build
run: npm run build

test-types:
name: Test Types with TypeScript ${{ matrix.ts }}

needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['16.x']
ts: ['4.1', '4.2', '4.3', '4.4', '4.5', '4.6', '4.7', '4.8', '4.9.2-rc']
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Install TypeScript ${{ matrix.ts }}
run: npm i --save-dev typescript@${{ matrix.ts }}

- name: Test types
run: |
npm run tsc -- --version
npm run check-types
npm run test:types
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"build": "rollup -c",
"prepublishOnly": "npm run clean && npm run check-types && npm run format:check && npm run lint && npm test",
"examples:lint": "eslint --ext js,ts examples",
"examples:test": "cross-env CI=true babel-node examples/testAll.js"
"examples:test": "cross-env CI=true babel-node examples/testAll.js",
"tsc": "tsc"
},
"dependencies": {},
"devDependencies": {
Expand Down

0 comments on commit bad6237

Please sign in to comment.