Skip to content

Commit ead68a2

Browse files
committed
ci: Add GitHub actions workflow for building, testing and saving debug apk artifact
1 parent c3180b9 commit ead68a2

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/android.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Android CI
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Set up JDK 21
12+
uses: actions/setup-java@v4
13+
with:
14+
java-version: '21'
15+
distribution: 'temurin'
16+
cache: gradle
17+
18+
- name: Grant execute permission for gradlew
19+
run: chmod +x gradlew
20+
21+
- name: Build debug APK with Gradle
22+
run: ./gradlew assembleDebug
23+
24+
- name: Run tests
25+
run: ./gradlew testDebugUnitTest
26+
27+
- name: Upload debug APK artifact
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: wikireader-debug
31+
path: ./app/build/outputs/apk/debug/app-debug.apk

app/build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
2+
import org.gradle.api.tasks.testing.logging.TestLogEvent
13
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
24

35
plugins {
@@ -66,6 +68,14 @@ android {
6668
}
6769
}
6870

71+
tasks.withType(Test::class) {
72+
testLogging {
73+
exceptionFormat = TestExceptionFormat.FULL
74+
events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
75+
showStandardStreams = true
76+
}
77+
}
78+
6979
dependencies {
7080
implementation(platform(libs.androidx.compose.bom))
7181
implementation(libs.androidx.activity.compose)

0 commit comments

Comments
 (0)