-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set up Android Github Action pipeline. Fixes #2892 #2893
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,41 @@ jobs: | |
chmod +x codecov | ||
./codecov | ||
|
||
# | ||
# Android build job | ||
# | ||
android: | ||
runs-on: macos-latest | ||
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" | ||
|
||
# Definition of the build matrix | ||
strategy: | ||
matrix: | ||
java: [ 11 ] | ||
entry: | ||
- { mock-maker: 'mock-maker-default', member-accessor: 'member-accessor-default' } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you want to keep a 1-element matrix? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually might want to introduce more API levels in the future, because they have different JVMs. See my comment on the issue, API 21 fails, while API 31 passes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I think we could remove the mock-maker part There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we settled on level 26 as the minimum: https://github.com/mockito/mockito/blob/main/build.gradle#L102 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For reference the official docs only list some new APIs, so even Android 8 doesn't support Java 11. However, as I understand with desugaring Java 11+ APIs can be used as low as API 1. This is of course not practical, I think an API 21 minimum would be enough. That said official full Java 11 support is only in 33. Anyway, based on the info, starting with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to clarify, the matrix should only change the emulator version, the compile/target/minSdk should be hardcoded to highest/lowest values as Google recommends it (TL;DR: we have ~1 year to use the latest target, otherwise cannot publish). |
||
|
||
# All build steps | ||
steps: | ||
- name: 1. Check out code | ||
uses: actions/checkout@v3 # https://github.com/actions/checkout | ||
reta marked this conversation as resolved.
Show resolved
Hide resolved
|
||
with: | ||
fetch-depth: '0' # https://github.com/shipkit/shipkit-changelog#fetch-depth-on-ci | ||
|
||
- name: 2. Set up Java ${{ matrix.java }} | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: ${{ matrix.java }} | ||
|
||
- name: 3. Run Android tests on Java ${{ matrix.java }} with ${{ matrix.entry.mock-maker }} and ${{ matrix.entry.member-accessor }} | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: 29 | ||
script: ./gradlew :androidTest:connectedCheck --no-daemon --no-build-cache | ||
TimvdLippe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
env: | ||
MOCK_MAKER: ${{ matrix.entry.mock-maker }} | ||
MEMBER_ACCESSOR: ${{ matrix.entry.member-accessor }} | ||
|
||
# | ||
# Release job, only for pushes to the main development branch | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI #2894
(I don't think it's necessary for this pipeline PR, but was inspired :) )