-
Notifications
You must be signed in to change notification settings - Fork 134
46 lines (38 loc) · 1.37 KB
/
minimum-version-ts-check.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Library checks
on:
pull_request:
push:
branches:
- main
jobs:
unit:
name: Check minimum TS version
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 16, 18, 20, 22, 23 ]
typescript-version: ['4.7.2', '5.5.4', 'latest' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8.x.x
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build project
run: pnpm run build
# once its built we can see if we can use it on the forced version
- name: Override TypeScript version
run: pnpm add typescript@${{ matrix.typescript-version }} --save-dev
- 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