# ============================================================================ # CI —— F《怨返》数据门(架构 §7.2;W1 激活部分) # # W1 激活:checkout → setup Godot 4.7.2 → headless import → SheetImporter # import_all → schema validate → build 漂移门(git diff) # W3 激活:GUT 单测(需先合入 gd-unit-testing addon) —— 见下方注释块 # W4 激活:headless sim 14 门报告(artifact) —— 见下方注释块 # W5 激活:Windows 导出 → artifact(templates + export_presets 补全) # # 待本机验证(4.7.x 超出训练数据): # - `godot --headless --path . --import` 的 4.7.2 实际行为(若失效改 -e --quit-after 200) # - setup-godot@v1 对 4.7.2 版本串/模板的支持 # 首跑后按实际更新本文件与 README §5。 # ============================================================================ name: CI on: push: branches: [main] pull_request: branches: [main] jobs: data-gate: name: data-gate(schema v0 数据门) runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Godot 4.7.2 uses: chickensoft-games/setup-godot@v1 with: version: 4.7.2 export-templates: false # W5 导出步骤再置 true - name: Godot version sanity run: godot --headless --version # 首次 import:生成全局类缓存 + 资源导入(SheetImporter 才能被解析) - name: Headless import run: godot --headless --path . --import # 数据门 1:CSV → build/*.json(schema 违规 = 中止 + 行号/列名/原因,退出码 1) - name: SheetImporter import_all run: godot --headless --path . -s res://src/tools/import_main.gd # 数据门 2:build/*.json 对 schema 合规性 - name: Schema validate run: godot --headless --path . -s res://src/tools/import_main.gd -- --validate-only # 数据门 3:漂移门——改了 CSV 没重新生成提交 build = 红("CI 生成并提交"纪律) # 行尾由 .gitattributes 钉 LF,避免格式性误报 - name: Build drift check run: git diff --exit-code -- data/build/ shell: bash # --------------------------------------------------------------------------- # W3 激活(前置:合入 gd-unit-testing addon 到 addons/gut/): # unit-tests: # runs-on: windows-latest # steps: # - uses: actions/checkout@v4 # - uses: chickensoft-games/setup-godot@v1 # with: { version: "4.7.2", export-templates: false } # - run: godot --headless --path . --import # - run: godot --headless --path . -s res://addons/gut/gut_cmdln.gd # -gtest=res://tests/unit -gexit # --------------------------------------------------------------------------- # --------------------------------------------------------------------------- # W4 激活(sim 14 门;W6 起门 #5/#10 设硬门,此前 informational): # sim-gates: # runs-on: windows-latest # steps: # - uses: actions/checkout@v4 # - uses: chickensoft-games/setup-godot@v1 # with: { version: "4.7.2", export-templates: false } # - run: godot --headless --path . --import # - run: godot --headless --path . -s res://src/core/sim/sim_main.gd # - uses: actions/upload-artifact@v4 # with: { name: sim-report, path: tests/sim_reports/ } # --------------------------------------------------------------------------- # --------------------------------------------------------------------------- # W5 激活(release tag:Windows 导出 → artifact → 人工上传 Steamworks): # export-windows: # if: startsWith(github.ref, 'refs/tags/') # runs-on: windows-latest # steps: # - uses: actions/checkout@v4 # - uses: chickensoft-games/setup-godot@v1 # with: { version: "4.7.2", export-templates: true } # - run: godot --headless --path . --import # - run: godot --headless --path . --export-release "Windows Desktop" build/wrath-of-the-dead.exe # - uses: actions/upload-artifact@v4 # with: { name: windows-build, path: build/ } # ---------------------------------------------------------------------------