Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [26, 31, 34]
api-level: [21, 26, 31, 34]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

big change!

# Allow other tests to continue if one fails
fail-fast: false

Expand All @@ -51,9 +51,17 @@ jobs:
echo "SDK Branch: android-sdk@${SDK_BRANCH}"
echo "API Level: ${{ matrix.api-level }}"

- name: Check out Common Java SDK
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

temporary until java.v4 is published (which we'll do when this and the java-server PRs are ready for merge)

uses: actions/checkout@v4
with:
repository: Eppo-exp/sdk-common-jdk
ref: typo/pull-json
path: sdk-common-jdk

- name: Check out Java SDK
uses: actions/checkout@v4
with:
path: android-sdk
repository: ${{ inputs.base_repo || github.repository }}
ref: ${{ env.SDK_BRANCH }}

Expand All @@ -69,7 +77,15 @@ jobs:
mkdir -p ~/.gradle/
echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3

- name: Publish Common SDK to Maven Local
working-directory: sdk-common-jdk
run: ./gradlew publishToMavenLocal --no-daemon

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build the common SDK and publish to a local repository for the Android SDK

- name: Set up test data
working-directory: android-sdk
run: make test-data branchName=${{env.TEST_DATA_BRANCH}}

- name: Wait for mock UFC DNS to resolve
Expand All @@ -92,10 +108,8 @@ jobs:
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3

- name: Run tests
working-directory: android-sdk
run: ./gradlew check --no-daemon

- name: AVD cache
Expand All @@ -105,7 +119,7 @@ jobs:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-api-${{ matrix.api-level }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
key: avd-api-${{ matrix.api-level }}-${{ hashFiles('android-sdk/**/*.gradle*', 'android-sdk/**/gradle-wrapper.properties') }}

- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -135,16 +149,16 @@ jobs:
touch app/emulator.log # create log file
chmod 777 app/emulator.log # allow writing to log file
adb logcat | grep EppoSDK >> app/emulator.log & # pipe all logcat messages into log file as a background process
./gradlew connectedCheck --no-daemon -Pandroid.testInstrumentationRunnerArguments.TEST_DATA_BRANCH=${{ env.TEST_DATA_BRANCH }} # run tests
cd android-sdk && ./gradlew connectedCheck --no-daemon -Pandroid.testInstrumentationRunnerArguments.TEST_DATA_BRANCH=${{ env.TEST_DATA_BRANCH }} # run tests

- name: Store reports on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: reports
path: |
**/build/reports/
**/build/test-results/
android-sdk/**/build/reports/
android-sdk/**/build/test-results/

- name: Upload Emulator Logs
if: always()
Expand All @@ -158,4 +172,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: report-api-level-${{ matrix.api-level }}
path: /Users/runner/work/android-sdk/android-sdk/eppo/build/reports/androidTests/connected/index.html
path: /Users/runner/work/android-sdk/android-sdk/android-sdk/eppo/build/reports/androidTests/connected/index.html
11 changes: 7 additions & 4 deletions eppo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {

defaultConfig {
namespace "cloud.eppo.android"
minSdk 26
minSdk 21
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop min to Android 21

targetSdk 34

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -38,7 +38,8 @@ android {
matchingFallbacks = ['debug']
}
}
compileOptions {
compileOptions { // Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Expand All @@ -52,6 +53,7 @@ android {
}
}


ext {}
ext.versions = [
"junit": "4.13.2",
Expand All @@ -68,14 +70,15 @@ ext.versions = [
]

dependencies {
api 'cloud.eppo:sdk-common-jvm:3.10.0'
api 'cloud.eppo:sdk-common-jvm:4.0.0'

coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'

implementation 'org.slf4j:slf4j-api:2.0.17'

implementation "androidx.core:core:${versions.androidx_core}"
implementation "com.squareup.okhttp3:okhttp:${versions.okhttp}"
implementation "com.github.zafarkhaja:java-semver:${versions.semver}"
implementation "com.fasterxml.jackson.core:jackson-databind:2.19.0"

testImplementation "junit:junit:${versions.junit}"
testImplementation "commons-io:commons-io:${versions.commonsio}"
Expand Down
Loading
Loading