From 5a3142bb4ac23295658e4e351b989fe6156dbe08 Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Wed, 26 Jun 2024 14:32:42 +0100 Subject: [PATCH] Run the type checker Refs #13 --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ package-lock.json | 16 +++++++++++++++- package.json | 3 ++- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 205e0c8..1cd0e02 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,6 +71,28 @@ jobs: - name: 'Run formatter' run: npx prettier --ignore-unknown --check '**' + typecheck: + name: 'Typecheck' + runs-on: ubuntu-22.04 + timeout-minutes: 30 + if: github.event_name != 'schedule' + + steps: + - name: 'Checkout code' + uses: actions/checkout@v4.1.7 + + - name: 'Set up Node.js' + uses: actions/setup-node@v4.0.2 + with: + node-version-file: package.json + cache: ${{ !env.ACT && 'npm' || '' }} + + - name: 'Install dependencies' + run: npm ci + + - name: 'Run typechecker' + run: npx tsc --noEmit + push: name: 'Push image' runs-on: ubuntu-22.04 @@ -81,6 +103,7 @@ jobs: needs: - build-image - format + - typecheck steps: - name: 'Set up flyctl' diff --git a/package-lock.json b/package-lock.json index 7f5c7e8..c2e777f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,8 @@ "@types/node": "^20.14.5", "prettier": "^3.3.2", "prettier-plugin-sh": "^0.14.0", - "prettier-plugin-toml": "^2.0.1" + "prettier-plugin-toml": "^2.0.1", + "typescript": "^5.5.2" }, "engines": { "node": ">=18" @@ -3903,6 +3904,19 @@ "@esbuild/win32-x64": "0.21.5" } }, + "node_modules/typescript": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", + "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/uc.micro": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", diff --git a/package.json b/package.json index b8bf856..b5dfecd 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "@types/node": "^20.14.5", "prettier": "^3.3.2", "prettier-plugin-sh": "^0.14.0", - "prettier-plugin-toml": "^2.0.1" + "prettier-plugin-toml": "^2.0.1", + "typescript": "^5.5.2" }, "engines": { "node": ">=18"