Repository navigation
62 lines (58 loc) · 2.63 KB
/
Copy pathscript-structure.yml
File metadata and controls
62 lines (58 loc) · 2.63 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
name: Script structure
# NDF のスクリプトの構造チェック(#1142 の I4・I5)。テストを除くスクリプトの 1000 行を超えるファイルと、
# 本体の同じ関数・同じ名前で本体の違う関数を数え、scripts/script-structure-allow/ の例外のほかに
# 当たれば落とす。例外リストの使われない項目も落とす(直した Pull Request が同じ差分でその項目のファイルを消す)。
#
# 同じワークフローの ndf-contracts-check は、エントリポイントの契約の一覧(plugins/ndf/contracts/)とコードを
# 突き合わせ、scripts/contract-allow/ の例外のほかに当たれば落とす。例外リストはベースブランチとの
# merge-base より増えると落とすため、履歴をすべて取る(fetch-depth: 0)。
#
# script-structure-check の後半の手順は、Issue の記載項目の定義(plugins/ndf/scripts/data/issue-items.json)と、
# GitHub のフォーム・out-of-scope の本文の骨格・仕様のテンプレートが食い違っていないかを確かめる(#2737 の一致の検査)。
#
# Pull Request では絞り込まずに常に起動する(pytest.yml と同じ理由)。数秒で終わる
on:
pull_request:
push:
branches:
- main
- develop
paths:
- ".github/workflows/script-structure.yml"
- ".github/ISSUE_TEMPLATE/**"
- "plugins/ndf/**"
- "scripts/check-script-structure.py"
- "scripts/script-structure-allow/**"
- "scripts/check-ndf-contracts.py"
- "scripts/contracts_lib/**"
- "scripts/contract-allow/**"
permissions:
contents: read
jobs:
script-structure-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.10"
- name: Check the script structure
run: python3 scripts/check-script-structure.py
# フォームの YAML と Markdown を読む部品は uv の環境から入る(deps.require が uv.lock の環境で起動し直す)
- uses: astral-sh/setup-uv@v10.3.3
with:
enable-cache: true
cache-dependency-glob: uv.lock
- name: Check the issue templates against the issue items
run: python3 plugins/ndf/scripts/issue-items.py templates --root .
ndf-contracts-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-python@v7
with:
python-version: "3.10"
- name: Check the NDF entrypoint contracts
run: python3 scripts/check-ndf-contracts.py