-
Notifications
You must be signed in to change notification settings - Fork 3
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
add workflows #2
Conversation
@@ -0,0 +1,49 @@ | |||
name: Pull Request |
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.
log for pull request workflow
https://github.com/yshrsmz/android-client-sdk/actions/runs/3089683437
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.
It seems to be a bit faster than Bitrise, but the on-push workflow takes more than I imagined.
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.
yeah, but subsequent runs should be faster as I've added cache step...
@@ -0,0 +1,85 @@ | |||
name: Build & Integration tests |
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.
log form main branch on-push workflow
https://github.com/yshrsmz/android-client-sdk/actions/runs/3089932156
|
||
androidTest: | ||
needs: build | ||
runs-on: macos-latest # enables hardware acceleration in the virtual machine |
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.
we need to use macos to run instrumentation test
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.
note: macos is 10 times more costly than ubuntu.
https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#per-minute-rates
@@ -8,7 +11,9 @@ plugins { | |||
} | |||
|
|||
def properties = new Properties() | |||
properties.load(rootProject.file('local.properties').newDataInputStream()) | |||
if (Files.exists(Paths.get("$rootProject.rootDir/local.properties"))) { |
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.
in CI environment, we don't have local.properties
so added a check.
should be fine because all necessary variables are provided via environment variables.
@@ -0,0 +1,16 @@ | |||
root=true |
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.
I forgot to add this in #1
name: bucketeer-build-reports | ||
path: bucketeer/build/reports | ||
|
||
androidTest: |
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.
The workflow for the main branch will run both unit tests and integration tests
run: ./gradlew assemble --stacktrace | ||
|
||
- name: Run Bucketeer unit tests | ||
run: ./gradlew :bucketeer:testDebugUnitTest --stacktrace |
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.
The workflow for pull-request will run lint, assemble, and unit tests. Integration tests will be executed on main branch.
~/.android/adb* | ||
key: avd-29 | ||
- name: Run instrumentation tests | ||
uses: reactivecircus/android-emulator-runner@v2 |
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.
I'm going to switch to Gradle Managed Device once we update AGP to 7.3.x
GMD should be much more reliable.
https://developer.android.com/studio/test/gradle-managed-devices
concurrency: | ||
group: build-${{ github.ref }} | ||
cancel-in-progress: true |
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.
CI build on a pull request will be canceled if you push a new commit to the 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.
Finally, we can migrate all SDK CIs to the same platform :)
Thank you!
Thanks! |
tested on my repo