This commit is contained in:
34
.github/workflows/ci.yml
vendored
Normal file
34
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main, master]
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 17
|
||||||
|
|
||||||
|
- uses: gradle/actions/setup-gradle@v4
|
||||||
|
|
||||||
|
- name: Spotless check
|
||||||
|
run: ./gradlew spotlessCheck --console=plain
|
||||||
|
|
||||||
|
- name: Unit tests
|
||||||
|
run: ./gradlew test testDebugUnitTest --console=plain
|
||||||
|
|
||||||
|
- name: Assemble debug APK
|
||||||
|
run: ./gradlew :app:assembleDebug --console=plain
|
||||||
|
|
||||||
|
- name: Architecture check
|
||||||
|
run: ./gradlew verifyArchitecture --console=plain
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: ./gradlew lintDebug --console=plain
|
||||||
49
scripts/verify.sh
Normal file
49
scripts/verify.sh
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# verify.sh — 确定性验证脚本(harness-engineering)
|
||||||
|
# 用法:bash scripts/verify.sh
|
||||||
|
# 任何一步失败即非零退出;所有成功声明以本脚本的新鲜输出为证据。
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
echo "==> 1/6 检查必需文件"
|
||||||
|
required_files=(
|
||||||
|
"AGENTS.md"
|
||||||
|
"README.md"
|
||||||
|
"docs/architecture.md"
|
||||||
|
"docs/conventions.md"
|
||||||
|
"docs/testing.md"
|
||||||
|
"docs/deployment.md"
|
||||||
|
"docs/progress.md"
|
||||||
|
"docs/decisions/0001-multi-module-nia.md"
|
||||||
|
"docs/decisions/0002-convention-plugins-and-version-catalog.md"
|
||||||
|
"docs/decisions/0003-toolchain-and-versions.md"
|
||||||
|
"docs/decisions/0004-package-name.md"
|
||||||
|
"gradle/libs.versions.toml"
|
||||||
|
"build-logic/convention/build.gradle.kts"
|
||||||
|
".editorconfig"
|
||||||
|
)
|
||||||
|
for f in "${required_files[@]}"; do
|
||||||
|
if [[ ! -f "$f" ]]; then
|
||||||
|
echo "缺失必需文件: $f" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo " OK"
|
||||||
|
|
||||||
|
echo "==> 2/6 spotlessCheck(确定性格式化)"
|
||||||
|
./gradlew spotlessCheck --console=plain
|
||||||
|
|
||||||
|
echo "==> 3/6 单元测试(JVM + Android)"
|
||||||
|
./gradlew test testDebugUnitTest --console=plain
|
||||||
|
|
||||||
|
echo "==> 4/6 构建调试 APK"
|
||||||
|
./gradlew :app:assembleDebug --console=plain
|
||||||
|
|
||||||
|
echo "==> 5/6 架构检查(模块依赖方向)"
|
||||||
|
./gradlew verifyArchitecture --console=plain
|
||||||
|
|
||||||
|
echo "==> 6/6 Android Lint"
|
||||||
|
./gradlew lintDebug --console=plain
|
||||||
|
|
||||||
|
echo "✅ 全部通过"
|
||||||
Reference in New Issue
Block a user