-
Notifications
You must be signed in to change notification settings - Fork 3
add workflows #2
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
Changes from all commits
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
root=true | ||
|
||
[*] | ||
insert_final_newline=true | ||
|
||
[*.md] | ||
trim_trailing_whitespace=false | ||
|
||
[*.gradle] | ||
indent_size=2 | ||
|
||
[*.{kt,kts}] | ||
indent_size=2 | ||
continuation_indent_size=4 | ||
ij_kotlin_allow_trailing_comma=true | ||
ij_kotlin_allow_trailing_comma_on_call_site=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Build & Integration tests | ||
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. log form main branch on-push workflow https://github.com/yshrsmz/android-client-sdk/actions/runs/3089932156 |
||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: 'temurin' | ||
java-version: 11 | ||
|
||
- name: Setup gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Ktlint | ||
run: ./gradlew lintKotlin --stacktrace | ||
|
||
- name: Check Lint | ||
run: ./gradlew lintDebug --stacktrace | ||
|
||
- name: Build all build types | ||
run: ./gradlew assemble --stacktrace | ||
|
||
- name: Run Bucketeer unit tests | ||
run: ./gradlew :bucketeer:testDebugUnitTest --stacktrace | ||
|
||
- name: upload bucketeer build reports | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: bucketeer-build-reports | ||
path: bucketeer/build/reports | ||
|
||
androidTest: | ||
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. The workflow for the main branch will run both unit tests and integration tests |
||
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. note: macos is 10 times more costly than ubuntu. |
||
timeout-minutes: 45 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: 'temurin' | ||
java-version: 11 | ||
|
||
- name: Setup gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: AVD cache | ||
uses: actions/cache@v3 | ||
id: avd-cache | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.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 commentThe 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 https://developer.android.com/studio/test/gradle-managed-devices |
||
env: | ||
API_KEY: ${{ secrets.E2E_API_KEY }} | ||
API_URL: ${{ secrets.E2E_API_URL }} | ||
with: | ||
api-level: 29 | ||
arch: x86_64 | ||
script: ./gradlew connectedCheck --stacktrace | ||
|
||
- name: upload bucketeer build reports | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: bucketeer-instrumentation-build-reports | ||
path: bucketeer/build/reports | ||
|
||
env: | ||
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-XX:+HeapDumpOnOutOfMemoryError -XX:MetaspaceSize=1g" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Pull Request | ||
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. 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 commentThe 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 commentThe 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... |
||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- '*.md' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: build-${{ github.ref }} | ||
cancel-in-progress: true | ||
Comment on lines
+9
to
+11
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. CI build on a pull request will be canceled if you push a new commit to the branch. |
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: 'temurin' | ||
java-version: 11 | ||
|
||
- name: Setup gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Ktlint | ||
run: ./gradlew lintKotlin --stacktrace | ||
|
||
- name: Check Lint | ||
run: ./gradlew lintDebug --stacktrace | ||
|
||
- name: Build all build types | ||
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 commentThe 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. |
||
|
||
- name: upload bucketeer build reports | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: bucketeer-build-reports | ||
path: bucketeer/build/reports | ||
|
||
env: | ||
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-XX:+HeapDumpOnOutOfMemoryError -XX:MetaspaceSize=1g" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
import java.nio.file.Files | ||
import java.nio.file.Paths | ||
|
||
plugins { | ||
alias(libs.plugins.android.library) | ||
alias(libs.plugins.kotlin.android) | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. in CI environment, we don't have |
||
properties.load(rootProject.file('local.properties').newDataInputStream()) | ||
} | ||
|
||
android { | ||
namespace = "io.bucketeer.sdk.android" | ||
|
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