Skip to content

Commit 64beca9

Browse files
authored
Verify the standalone build on every pull request (#3)
Every module is built two ways: inside the android-sdk aggregate build, and on its own. Development happens in the aggregate build, so the standalone side rots silently — it is only exercised when the publish workflow runs, which is to say on release day. Add a `build.yml` that assembles the module on its own for every pull request, so this drift surfaces when the change is made instead of at release time. Where needed this commit also repairs the standalone build itself (missing wrapper/settings, missing version-catalog entries, dependency versions that had drifted from the aggregate build).
1 parent f9be7fd commit 64beca9

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build
2+
3+
# 単体ビルドの検証。
4+
#
5+
# ## なぜ要るのか
6+
#
7+
# このモジュールは android-sdk の集約ビルドと、自分だけの単体ビルドの
8+
# 2 通りで組まれる。開発は集約ビルドで行うため、**単体ビルド側の設定が
9+
# 静かに腐る。** 実際 1.3.0 のリリースでは、publish ワークフローを回して
10+
# 初めて次のような不備がまとめて露見した:
11+
#
12+
# - gradlew / settings.gradle.kts が無くて ./gradlew が叩けない
13+
# - version catalog に依存の定義が無い(集約側の catalog にはある)
14+
# - coroutines が推移的に古い版になり 3 引数 resume が通らない
15+
# - ベンダ SDK の版が集約ビルドと食い違う
16+
#
17+
# publish のときにしか単体ビルドしないと、リリース当日に気づくことになる。
18+
# ここで PR ごとに回して、変更した時点で分かるようにする。
19+
20+
on:
21+
pull_request:
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
build:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Set up Java
34+
uses: actions/setup-java@v4
35+
with:
36+
distribution: temurin
37+
java-version: '17'
38+
cache: 'gradle'
39+
40+
- name: Build core and compose locally
41+
run: |
42+
git clone --depth 1 https://github.com/MapConductor/android-sdk-core.git _core
43+
cd _core
44+
./gradlew --no-daemon publishToMavenLocal
45+
cd ..
46+
47+
mkdir -p "$HOME/.gradle/init.d"
48+
cat > "$HOME/.gradle/init.d/use-local-maven.init.gradle" << 'EOF'
49+
gradle.settingsEvaluated { settings ->
50+
settings.dependencyResolutionManagement.repositories {
51+
mavenLocal()
52+
}
53+
}
54+
EOF
55+
56+
git clone --depth 1 https://github.com/MapConductor/android-sdk-compose.git _compose
57+
cd _compose
58+
./gradlew --no-daemon publishToMavenLocal
59+
cd ..
60+
61+
# apiCheck は集約ビルド(android-sdk)の gradle/api-surface.gradle.kts が
62+
# 提供するタスクで、単体ビルドには存在しない。ここでは組み立てだけを見る。
63+
- name: Assemble
64+
run: ./gradlew --no-daemon -PskipSampleApp=true assembleRelease

0 commit comments

Comments
 (0)