Fix keyboard inset restoration and improve rotation handling #43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 库仓 CI:静态检查 + SPM 构建烟囱测试。 | |
| # Example 全量单测 / UI 测在同仓 `.github/workflows/example-tests.yml`(根目录 `STBaseProject.xcworkspace`)。 | |
| name: Swift | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: macos-15 | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # 默认 xcode-select 常为旧版;脚本按 Info.plist 版本号选 /Applications 下最高的 Xcode(见 .github/select_xcode_ci.sh)。 | |
| - name: Select Xcode | |
| run: bash "${GITHUB_WORKSPACE}/.github/select_xcode_ci.sh" | |
| - name: Check try? policy | |
| run: bash .github/check_try_question_mark.sh | |
| - name: SwiftLint | |
| run: | | |
| if ! command -v swiftlint >/dev/null 2>&1; then | |
| brew install swiftlint | |
| fi | |
| swiftlint version | |
| # --strict:所有 warning 提升为 error。已清零规则(force_unwrapping、modifier_order、 | |
| # convenience_type、computed_accessors_order 等)一旦回归即阻断构建。 | |
| # missing_docs 存量未清零,已从 opt_in_rules 移入 disabled_rules(见 .swiftlint.yml), | |
| # 补齐文档后恢复并继续由 --strict 守护。 | |
| swiftlint --strict --reporter github-actions-logging | |
| - name: Resolve SPM dependencies | |
| run: xcodebuild -resolvePackageDependencies -scheme STBaseProject | |
| - name: Build (iOS Simulator) with compile log | |
| run: | | |
| # 完整编译日志供 swiftlint analyze 使用(analyzer_rules 依赖 type-checked AST)。 | |
| # 不使用增量构建缓存,确保日志完整。 | |
| rm -rf ~/Library/Developer/Xcode/DerivedData | |
| xcodebuild \ | |
| -scheme STBaseProject \ | |
| -destination 'generic/platform=iOS Simulator' \ | |
| clean build | tee xcodebuild.log | |
| - name: SwiftLint Analyze (unused_import / unused_declaration) | |
| run: | | |
| # analyzer_rules 仅在 `swiftlint analyze` 下执行;普通 `swiftlint lint` 不会跑。 | |
| # 需完整编译日志(上方 Build 步骤产出 xcodebuild.log)。 | |
| swiftlint analyze --strict \ | |
| --compiler-log-path xcodebuild.log \ | |
| --reporter github-actions-logging | |