From 60ef15ef4212fe1626056746a3cb11d0cb9e5ab7 Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Sun, 12 Feb 2023 14:17:24 -0500 Subject: [PATCH] Add a build step and TS typetest matrix to the existing workflow --- .github/workflows/test.yaml | 35 +++++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 370c1586d3a..7caa3807774 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -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 diff --git a/package.json b/package.json index a4df23e34be..6edbdb77c9c 100644 --- a/package.json +++ b/package.json @@ -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": {