From 7798681b10c426145bc28421a1db18fe308b2b0a Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Thu, 19 Dec 2024 19:20:59 +0000 Subject: [PATCH] Try this --- .../workflows/minimum-version-ts-check.yaml | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/minimum-version-ts-check.yaml b/.github/workflows/minimum-version-ts-check.yaml index 937c75ebd..dfaf8e3b2 100644 --- a/.github/workflows/minimum-version-ts-check.yaml +++ b/.github/workflows/minimum-version-ts-check.yaml @@ -15,15 +15,31 @@ jobs: node-version: [ 16, 18, 20 ] typescript-version: [ '4.7.3', '5.5.4' ] steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 with: version: 8.x.x - - uses: actions/setup-node@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' - - run: pnpm install - #Override TypeScript version - - run: pnpm install typescript@${{ matrix.typescript-version }} - - run: pnpm tsc -b + + - name: Install dependencies + run: pnpm install + + - name: Override TypeScript version + run: pnpm add typescript@${{ matrix.typescript-version }} --save-dev + + - name: Build project + run: pnpm run build + + - name: Test TypeScript Import + run: | + rm test.ts || true + echo "import { posthog } from './dist/module'; console.log(posthog);" > test.ts + pnpm exec tsc test.ts --strict --target es2017 --module commonjs --moduleResolution node --noEmit --skipLibCheck \ No newline at end of file