Skip to content

Commit

Permalink
Run AndroidTest in GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
takahirom committed Apr 4, 2024
1 parent 0c79d9e commit 6692ef4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
os: ubuntu-latest
# - target: linuxX64Test
# os: ubuntu-latest
- target: testDebugUnitTest
- target: pixel2api30DebugAndroidTest
os: ubuntu-latest
- target: testReleaseUnitTest
os: ubuntu-latest
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ Work in progress
## how do i build it?
1. - [x] clone this repository ot just [use it as template](https://github.com/kotlin/multiplatform-library-template/generate)
1. - [ ] edit library module name and include it in [`settings.gradle.kts`](settings.gradle.kts#l18)
1. - [ ] Edit [`groupId` and `version`](convention-plugins/src/main/kotlin/module.publication.gradle.kts#L10-L11)
1. - [x] edit library module name and include it in [`settings.gradle.kts`](settings.gradle.kts#l18)
1. - [x] Edit [`groupId` and `version`](convention-plugins/src/main/kotlin/module.publication.gradle.kts#L10-L11)
1. If you need the Android support update namespace [there](library/build.gradle.kts#L38) too
1. If you don't need an Android support delete the [`android` section](library/build.gradle.kts#L37-L43)
1. - [ ] Edit [build targets you need](library/build.gradle.kts#L9-L21)
1. - [x] Edit [build targets you need](library/build.gradle.kts#L9-L21)
At this stage, you have everything set to work with Kotlin Multiplatform. The project should be buildable (but you might need to provide actual starting values for the platforms you need).
Expand All @@ -131,16 +131,16 @@ Also, currently, it only runs tests, but you can change this behaviour as you wi
The most part of the job is already automated for you. However, deployment to Maven Central requires some manual work from your side.
1. - [ ] Create an account at [Sonatype issue tracker](https://issues.sonatype.org/secure/Signup!default.jspa)
1. - [ ] [Create an issue](https://issues.sonatype.org/secure/CreateIssue.jspa?issuetype=21&pid=10134) to create new project for you
1. - [ ] You will have to prove that you own your desired namespace
1. - [ ] Create a GPG key with `gpg --gen-key`, use the same email address you used to sign up to the Sonatype Jira
1. - [ ] Find your key id in the output of the previous command looking like `D89FAAEB4CECAFD199A2F5E612C6F735F7A9A519`
1. - [ ] Upload your key to a keyserver, for example
1. - [x] Create an account at [Sonatype issue tracker](https://issues.sonatype.org/secure/Signup!default.jspa)
1. - [x] [Create an issue](https://issues.sonatype.org/secure/CreateIssue.jspa?issuetype=21&pid=10134) to create new project for you
1. - [x] You will have to prove that you own your desired namespace
1. - [x] Create a GPG key with `gpg --gen-key`, use the same email address you used to sign up to the Sonatype Jira
1. - [x] Find your key id in the output of the previous command looking like `D89FAAEB4CECAFD199A2F5E612C6F735F7A9A519`
1. - [x] Upload your key to a keyserver, for example
```bash
gpg --send-keys --keyserver keyserver.ubuntu.com "<your key id>"
```
1. - [ ] Now you should create secrets available to your GitHub Actions
1. - [x] Now you should create secrets available to your GitHub Actions
1. via `gh` command
```bash
gh secret set OSSRH_GPG_SECRET_KEY -a actions --body "$(gpg --export-secret-key --armor "<your key id>")"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

allprojects {
group = "org.jetbrains.kotlinx.multiplatform-library-template"
group = "io.github.takahirom.rin"
version = "0.0.1"
}

Expand Down
14 changes: 14 additions & 0 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,18 @@ android {
minSdk = libs.versions.android.minSdk.get().toInt()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
testOptions {
managedDevices {
localDevices {
create("pixel2api30") {
// Use device profiles you typically see in Android Studio.
device = "Pixel 2"
// Use only API levels 27 and higher.
apiLevel = 30
// To include Google services, use "google".
systemImageSource = "aosp"
}
}
}
}
}

0 comments on commit 6692ef4

Please sign in to comment.