Skip to content

Commit c429a3b

Browse files
committed
GitHub workflow: Run harmless gradlew command due to warnings
We have a workflow job which runs: ./gradlew -q printLineCoverage which should ONLY print out a number (e.g. 99.7) but unfortunately the Android plugin spams a bunch of noise on first run that we don't care about (that's why we pass in the `-q` option). This is causing the "COVERAGE=(./gradlew -q printLineCoverage)>>GITHUB_ENV" action to fail. The output looks like: ``` Warning: Errors during XML parse: Warning: Additionally, the fallback loader failed to parse the XML. Checking the license for package Android SDK Platform-Tools in /usr/local/lib/android/sdk/licenses License for package Android SDK Platform-Tools accepted. Preparing "Install Android SDK Platform-Tools v.35.0.2". "Install Android SDK Platform-Tools v.35.0.2" ready. Installing Android SDK Platform-Tools in /usr/local/lib/android/sdk/platform-tools "Install Android SDK Platform-Tools v.35.0.2" complete. "Install Android SDK Platform-Tools v.35.0.2" finished. 99.7 ``` By running a harmless Gradle command first, we clear this initial noise out of the way so that printLineCoverage can run cleanly.
1 parent 2351f26 commit c429a3b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/coverage-badge.yml

+8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ jobs:
2828
path: ~/.konan
2929
key: kotlin-native-compiler-${{ runner.OS }}
3030

31+
# At some point, the Android plugin started getting chatty with its output
32+
# and spams stuff like "Install Android SDK ..."
33+
# This will mess up the next command (gradlw -q printLineCoverage) so we just
34+
# run a harmless task first.
35+
- name: Run Gradle once to clear Android startup messages
36+
run: |
37+
${{github.workspace}}/gradlew tasks
38+
3139
- name: Generate coverage output
3240
run: |
3341
echo "COVERAGE=$(${{github.workspace}}/gradlew -q printLineCoverage)" >> $GITHUB_ENV

0 commit comments

Comments
 (0)