Skip to content

Commit 1ff6db8

Browse files
Enable Spotless verification for Android Port and consolidate reporting
- Added `spotless-maven-plugin` to `maven/android/pom.xml` configured for `Ports/Android/src`. - Updated `scripts/build-android-port.sh` to run `spotless:check` and capture results to a report file. - Modified `scripts/lib/cn1ss.sh` and `scripts/run-android-instrumentation-tests.sh` to append the Spotless report to the main Android status comment. - Updated `scripts/run-android-instrumentation-tests.sh` to fail the build if Spotless checks failed, after reporting is complete. - Updated `.github/workflows/scripts-android.yml` and reporting scripts to suppress noisy "missing report" warnings and correctly collect test artifacts.
1 parent dc8a1e9 commit 1ff6db8

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

scripts/build-android-port.sh

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,8 @@ SPOTLESS_REPORT="$ARTIFACTS_DIR/spotless-report.md"
140140
SPOTLESS_LOG="$ARTIFACTS_DIR/spotless.log"
141141

142142
log "Running Spotless verification with JAVA_HOME=$JAVA17_HOME"
143-
if JAVA_HOME="$JAVA17_HOME" run_maven -X -f maven/pom.xml -pl android -Dcn1.binaries="$CN1_BINARIES" -P !download-cn1-binaries -Djava.awt.headless=true com.diffplug.spotless:spotless-maven-plugin:check > "$SPOTLESS_LOG" 2>&1; then
144-
{
145-
echo "✅ **Spotless:** Passed"
146-
echo ""
147-
echo "Files checked:"
148-
grep "Spotless checks" "$SPOTLESS_LOG" || echo "Count not found in log"
149-
echo ""
150-
echo "<details><summary>Full Spotless Log (Success)</summary>"
151-
echo ""
152-
echo "\`\`\`"
153-
cat "$SPOTLESS_LOG"
154-
echo "\`\`\`"
155-
echo ""
156-
echo "</details>"
157-
} > "$SPOTLESS_REPORT"
143+
if JAVA_HOME="$JAVA17_HOME" run_maven -e -f maven/pom.xml -pl android -Dcn1.binaries="$CN1_BINARIES" -P !download-cn1-binaries -Djava.awt.headless=true com.diffplug.spotless:spotless-maven-plugin:check > "$SPOTLESS_LOG" 2>&1; then
144+
echo "✅ **Spotless:** Passed" > "$SPOTLESS_REPORT"
158145
else
159146
log "Spotless check failed. See artifacts/spotless.log"
160147
{

scripts/run-android-instrumentation-tests.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,12 @@ cp -f "$TEST_LOG" "$ARTIFACTS_DIR/device-runner-logcat.txt" 2>/dev/null || true
270270
[ -n "${TEST_EXEC_LOG:-}" ] && cp -f "$TEST_EXEC_LOG" "$ARTIFACTS_DIR/test-results.log" 2>/dev/null || true
271271

272272
if [ -f "$ARTIFACTS_DIR/build_failed.txt" ]; then
273-
ra_log "FATAL: Build failed in a previous step (see artifacts)"
273+
if [ -f "$CN1SS_EXTRA_MARKDOWN_FILE" ]; then
274+
ra_log "---- Failure Report ----"
275+
cat "$CN1SS_EXTRA_MARKDOWN_FILE"
276+
ra_log "------------------------"
277+
fi
278+
ra_log "FATAL: Build failed in a previous step (see artifacts or report above)"
274279
exit 1
275280
fi
276281

0 commit comments

Comments
 (0)