From 4fa273c3715c07782b4c11352839a60c918c6b4d Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:05:07 -0800 Subject: [PATCH] Check types in CI Previously, the only enforcement of TypeScript was through ESLint rules from @typescript-eslint. --- .github/workflows/ci.yml | 10 ++++++++++ package.json | 1 + 2 files changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1eeda2a95..de3994d7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,16 @@ jobs: - run: npm run lint:static-site - run: node ./scripts/check-resource-index-match.js + type-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: 'package.json' + - run: npm ci + - run: npm run type-check + # Build into Heroku slug so we can deploy the same build that we test. build: runs-on: ubuntu-latest diff --git a/package.json b/package.json index 6de3d7c74..1028ed683 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "lint": "npm run lint:server", "lint:server": "DEBUG=eslint:cli-engine npx eslint --max-warnings=0 --ext .js,.jsx .", "lint:static-site": "cd static-site && DEBUG=eslint:cli-engine npx eslint --max-warnings=0 --ext .js,.jsx,.ts,.tsx .", + "type-check": "cd static-site && tsc", "server": "node server.js", "groups": "node server.js --app ./src/groupsApp.js", "start": "npm run server",