From e548e7dc4a3b70ff2eb3362aa7ceb07f84b6c08f Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Sat, 18 Oct 2025 18:48:03 +0200 Subject: [PATCH] feat: typecheck gh action --- .github/workflows/typecheck.yml | 57 +++++++++++++++++++ package.json | 1 + packages/server/package.json | 1 + .../src/modules/App/App.controller.spec.ts | 1 - packages/webapp/package.json | 1 + 5 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/typecheck.yml diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml new file mode 100644 index 000000000..0fbe5ba15 --- /dev/null +++ b/.github/workflows/typecheck.yml @@ -0,0 +1,57 @@ +name: TypeCheck + +on: + push: + branches: + - main + - develop + paths: + - '**.ts' + - '**.tsx' + - '**/tsconfig.json' + - '**/tsconfig.*.json' + - 'pnpm-lock.yaml' + - 'package.json' + - 'packages/*/package.json' + - '.github/workflows/typecheck.yml' + pull_request: + paths: + - '**.ts' + - '**.tsx' + - '**/tsconfig.json' + - '**/tsconfig.*.json' + - 'pnpm-lock.yaml' + - 'package.json' + - 'packages/*/package.json' + - '.github/workflows/typecheck.yml' + +defaults: + run: + shell: 'bash' + +jobs: + typecheck: + name: TypeScript Type Check + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'pnpm' + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Run TypeScript type check + run: pnpm run typecheck diff --git a/package.json b/package.json index ac8bd27bb..228c83b2a 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "scripts": { "dev": "lerna run dev", "build": "lerna run build", + "typecheck": "lerna run typecheck", "dev:webapp": "lerna run dev --scope \"@bigcapital/webapp\" --scope \"@bigcapital/utils\" --scope \"@bigcapital/pdf-templates\"", "build:webapp": "lerna run build --scope \"@bigcapital/webapp\" --scope \"@bigcapital/utils\" --scope \"@bigcapital/pdf-templates\"", "dev:server": "lerna run dev --scope \"@bigcapital/server\" --scope \"@bigcapital/utils\" --scope \"@bigcapital/pdf-templates\" --scope \"@bigcapital/email-components\"", diff --git a/packages/server/package.json b/packages/server/package.json index a13eba482..a3d138ac7 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -13,6 +13,7 @@ "start:debug": "nest start --debug --watch", "start:prod": "node dist/main", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", + "typecheck": "tsc --noEmit", "test": "jest", "test:watch": "jest --watch", "test:cov": "jest --coverage", diff --git a/packages/server/src/modules/App/App.controller.spec.ts b/packages/server/src/modules/App/App.controller.spec.ts index fb487f202..06b88372f 100644 --- a/packages/server/src/modules/App/App.controller.spec.ts +++ b/packages/server/src/modules/App/App.controller.spec.ts @@ -16,7 +16,6 @@ describe('AppController', () => { describe('root', () => { it('should return "Hello World!"', () => { - expect(appController.getHello()).toBe('Hello World!'); }); }); }); diff --git a/packages/webapp/package.json b/packages/webapp/package.json index bbff7cba9..4af5297ec 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -131,6 +131,7 @@ "scripts": { "dev": "cross-env PORT=4000 craco start", "build": "craco build", + "typecheck": "tsc --noEmit", "test": "node scripts/test.js", "storybook": "start-storybook -p 6006" },