Skip to content

Commit 30b13b9

Browse files
author
jiangpeiling
committed
🔨 Add auto web type check.
1 parent da73578 commit 30b13b9

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Run Auto Web Check
2+
3+
concurrency:
4+
group: auto-web-check-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
runner_label_json:
11+
description: 'runner array in json format (e.g. ["ubuntu-latest"] or ["self-hosted"])'
12+
default: '["ubuntu-latest"]'
13+
pull_request:
14+
branches: [develop]
15+
paths:
16+
- 'frontend/**'
17+
- '.github/workflows/**'
18+
push:
19+
branches: [develop]
20+
paths:
21+
- 'frontend/**'
22+
- '.github/workflows/**'
23+
24+
jobs:
25+
type-check:
26+
runs-on: ${{ fromJson(github.event.inputs.runner_label_json || '["ubuntu-latest"]') }}
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: Set up Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: '18'
35+
cache: 'npm'
36+
cache-dependency-path: frontend/package-lock.json
37+
38+
- name: Run TypeScript type check
39+
run: |
40+
cd frontend
41+
npm run type-check
42+
TYPE_CHECK_EXIT_CODE=$?
43+
44+
# Check if type check actually passed
45+
if [ $TYPE_CHECK_EXIT_CODE -ne 0 ]; then
46+
echo "❌ Type check failed with exit code $TYPE_CHECK_EXIT_CODE"
47+
exit $TYPE_CHECK_EXIT_CODE
48+
else
49+
echo "✅ Type check passed successfully."
50+
fi

0 commit comments

Comments
 (0)