-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.43 KB
/
Copy pathcheck.yml
File metadata and controls
43 lines (36 loc) · 1.43 KB
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
name: Check
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
check:
name: ${{ matrix.os }} · node ${{ matrix.node }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# 三个平台都跑:核心脚本的很多决定是平台相关的(行尾、路径分隔符、
# Git Bash 走不走、CJK 宽度),只在 Linux 上绿过不等于能用。
os: [ubuntu-latest, windows-latest, macos-latest]
node: ['18', '22']
steps:
# 固定到提交,不用可变的 major 标签:标签能被改指,提交不能。
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ matrix.node }}
- name: dsh 组件测试需要的 React
shell: bash
working-directory: plugins/dsh
run: |
mkdir -p .devdeps && cd .devdeps
echo '{"name":"devdeps","private":true}' > package.json
npm install --no-audit --no-fund react@18 react-dom@18
# 全部检查都在这个脚本里:同步一致性、渲染断言、隐藏逻辑、阈值与钩子、
# 静态检查、密钥扫描、dsh 的 141 项。本地跑同一条命令,不会出现"本地过 CI 挂"。
- name: 仓库检查
run: node scripts/check.mjs