Skip to content

Commit 4496a13

Browse files
committed
check TS
1 parent f5b10da commit 4496a13

File tree

3 files changed

+65
-121
lines changed

3 files changed

+65
-121
lines changed

.github/workflows/ci.yml

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

.github/workflows/typescript.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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: Install pnpm globally
31+
- name: Install pnpm globally
32+
run: |
33+
corepack enable
34+
corepack prepare [email protected] --activate
35+
36+
# Step 4: Cache pnpm dependencies (pnpm store and node_modules)
37+
- name: Cache pnpm dependencies
38+
uses: actions/cache@v3
39+
with:
40+
path: |
41+
~/.pnpm-store
42+
node_modules
43+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
44+
restore-keys: |
45+
${{ runner.os }}-pnpm-store-
46+
47+
# Step 5: Install dependencies
48+
- name: Install dependencies
49+
run: pnpm install
50+
51+
# Step 6: Run TypeScript Check and Save Logs
52+
- name: Run TypeScript Check
53+
run: |
54+
mkdir -p logs
55+
pnpm --filter packages/idb-cache typescript:check > logs/typescript-errors.log 2>&1 || true
56+
57+
# Step 7: Upload TypeScript Logs (on failure)
58+
- name: Upload TypeScript Logs
59+
if: failure()
60+
uses: actions/upload-artifact@v3
61+
with:
62+
name: typescript-errors
63+
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)