Skip to content

Commit eb4b63e

Browse files
committed
check TS
1 parent f5b10da commit eb4b63e

File tree

4 files changed

+70
-122
lines changed

4 files changed

+70
-122
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 120 deletions
This file was deleted.

.github/workflows/playwright.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Run Playwright tests"
1+
name: "Playwright Tests"
22

33
on:
44
pull_request:

.github/workflows/typescript.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: TypeScript Check
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'releases/*'
8+
pull_request:
9+
branches:
10+
- main
11+
- 'releases/*'
12+
workflow_dispatch:
13+
14+
jobs:
15+
type-check:
16+
name: Run TypeScript Check for idb-cache
17+
runs-on: ubuntu-22.04
18+
19+
steps:
20+
# Step 1: Checkout the repository
21+
- uses: actions/checkout@v4
22+
23+
# Step 2: Setup Node.js with pnpm caching
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '20'
28+
cache: 'pnpm'
29+
30+
# Step 3: Setup pnpm using the official action
31+
- name: Setup pnpm
32+
uses: pnpm/action-setup@v2
33+
with:
34+
version: 9.8.1
35+
36+
# Optional: Verify pnpm installation
37+
- name: Verify pnpm Installation
38+
run: pnpm --version
39+
40+
# Step 4: Cache pnpm dependencies (pnpm store and node_modules)
41+
- name: Cache pnpm dependencies
42+
uses: actions/cache@v3
43+
with:
44+
path: |
45+
~/.pnpm-store
46+
node_modules
47+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
48+
restore-keys: |
49+
${{ runner.os }}-pnpm-store-
50+
51+
# Step 5: Install dependencies
52+
- name: Install dependencies
53+
run: pnpm install
54+
55+
# Step 6: Run TypeScript Check and Save Logs
56+
- name: Run TypeScript Check
57+
run: |
58+
mkdir -p logs
59+
pnpm --filter packages/idb-cache typescript:check > logs/typescript-errors.log 2>&1 || true
60+
61+
# Step 7: Upload TypeScript Logs (on failure)
62+
- name: Upload TypeScript Logs
63+
if: failure()
64+
uses: actions/upload-artifact@v3
65+
with:
66+
name: typescript-errors
67+
path: logs/typescript-errors.log

packages/idb-cache/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"scripts": {
2424
"build": "rslib build",
2525
"dev": "rslib build --watch",
26-
"biome:check": "biome check . --write"
26+
"biome:check": "biome check . --write",
27+
"typescript:check": "tsc --noEmit"
2728
},
2829
"peerDependencies": {
2930
"@rslib/core": "^0.0.15"

0 commit comments

Comments
 (0)