Skip to content

Commit 2485691

Browse files
jamesarichclaude
andcommitted
ci(release): konan cache, memory caps, exclude samples from release build
Three hardening fixes after v0.1.0's second attempt OOMed: 1. Cache ~/.konan like the CI test jobs do — the release job was re-downloading the Kotlin/Native toolchain and rebuilding klibs cold every run (>1h in assemble). 2. Cap build memory via GRADLE_USER_HOME properties (they take precedence over the project's gradle.properties, so this holds even when dispatch builds an older tag): 3g Gradle heap, 2g Kotlin daemon, 2 workers — the project's -Xmx4g + full parallelism oversubscribes the 7GB macOS runner. 3. Exclude :samples:* from the assemble/check gates. Samples are CI-gated on every PR and are not published; their RELEASE-mode iOS framework links run the K/N devirtualization pass, which is what actually threw java.lang.OutOfMemoryError (attempt 2 died in :samples:parity-app:linkReleaseFrameworkIosArm64). Verified with --dry-run: 544 tasks scheduled, zero from :samples:*, all published modules (bom, core, transports, storage, testing) still built. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
1 parent 71d14ed commit 2485691

1 file changed

Lines changed: 40 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,31 @@ jobs:
7070
submodules: recursive
7171
fetch-depth: 0 # axion-release reads tags
7272

73+
# The release job cross-compiles every Kotlin/Native target; without
74+
# this cache each release run re-downloads the konan toolchain and
75+
# rebuilds dependency klibs from scratch (the CI test jobs have had
76+
# this cache all along — v0.1.0's first attempt ran >1h cold).
77+
- name: Cache Konan
78+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
79+
with:
80+
path: ~/.konan
81+
key: konan-${{ runner.os }}-${{ hashFiles('gradle/libs.versions.toml','gradle/wrapper/gradle-wrapper.properties') }}
82+
restore-keys: |
83+
konan-${{ runner.os }}-
84+
85+
# Cap build memory below the macOS runner's budget. The project
86+
# gradle.properties asks for -Xmx4g and full parallelism, which — plus
87+
# the Kotlin daemon and konan compilers — swap-thrashes the runner.
88+
# GRADLE_USER_HOME properties take precedence over the project's.
89+
- name: Cap Gradle memory for the runner
90+
run: |
91+
mkdir -p ~/.gradle
92+
{
93+
echo "org.gradle.jvmargs=-Xmx3g -XX:MaxMetaspaceSize=768m -Dfile.encoding=UTF-8"
94+
echo "org.gradle.workers.max=2"
95+
echo "kotlin.daemon.jvmargs=-Xmx2g"
96+
} >> ~/.gradle/gradle.properties
97+
7398
- uses: ./.github/actions/gradle-setup
7499
with:
75100
cache_read_only: 'true'
@@ -85,11 +110,24 @@ jobs:
85110
exit 1
86111
fi
87112
113+
# Samples are excluded: they are CI-gated on every PR and are not
114+
# published, and their RELEASE-mode iOS framework links run the
115+
# Kotlin/Native devirtualization pass, which OOMs the 7GB macOS
116+
# runner (v0.1.0 attempt 2 died there). -x also drops tasks
117+
# reachable only through the excluded ones (the link tasks).
88118
- name: Build all artifacts
89-
run: ./gradlew assemble
119+
run: >
120+
./gradlew assemble
121+
-x :samples:cli:assemble
122+
-x :samples:parity-app:assemble
123+
-x :samples:parity-android-app:assemble
90124
91125
- name: Run gate
92-
run: ./gradlew check
126+
run: >
127+
./gradlew check
128+
-x :samples:cli:check
129+
-x :samples:parity-app:check
130+
-x :samples:parity-android-app:check
93131
94132
- name: Check Maven Central state
95133
# Probe whether this version is already on Maven Central. If it is,

0 commit comments

Comments
 (0)