-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (55 loc) · 1.97 KB
/
api-compliance.yml
File metadata and controls
66 lines (55 loc) · 1.97 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# 只读校验:tdesign_api.yaml 清单 + analyzer AST validate,不写回 tdesign-flutter 源码
name: API 文档合规性校验
on:
pull_request:
branches: [develop, main]
types: [opened, synchronize, reopened]
push:
branches: [develop, main]
workflow_dispatch:
concurrency:
group: api-compliance-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
FLUTTER_VERSION: "3.32.0"
FLUTTER_REPO: tdesign-flutter
FLUTTER_BRANCH: develop
jobs:
validate-api-docs:
name: YAML 清单 + AST 合规性
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: 检出 tools 仓库
uses: actions/checkout@v4
- name: 安装 Flutter / Dart
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache: true
- name: 解析 tools 依赖
run: flutter pub get
- name: 静态分析 tools
run: dart analyze --fatal-infos
- name: 克隆 tdesign-flutter(测试与 validate 共用)
run: |
git clone --depth 1 --branch "${FLUTTER_BRANCH}" \
https://github.com/Tencent/tdesign-flutter.git "${FLUTTER_REPO}"
- name: 单元测试(完备性相关)
env:
TDESIGN_COMPONENT_ROOT: ${{ github.workspace }}/${{ env.FLUTTER_REPO }}/tdesign-component
run: |
dart test test/aux_types_test.dart \
test/ctor_defaults_test.dart \
test/duplicate_source_test.dart \
test/factory_ctor_test.dart \
test/enum_members_test.dart \
test/positional_ctor_test.dart
- name: 运行 AST 完备性检测(非零 exit code 即失败)
run: |
dart run bin/main.dart validate \
--component-root "${{ github.workspace }}/${FLUTTER_REPO}/tdesign-component" \
--config .github/config/tdesign_api.yaml