Skip to content
Merged
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
48 changes: 28 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
java-version: 17.0.10
distribution: "adopt"

- name: Set up Gradle (caching)
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true

- name: Write to local.properties
run: |
echo BACKTRACE_SUBMISSION_URL=\"${{ secrets.BACKTRACE_SUBMISSION_URL }}\" >> ./local.properties
Expand All @@ -38,11 +43,16 @@ jobs:
- name: Bugfix libunwindstack-ndk .clang-format symbolic link issue
run: rm ./backtrace-library/src/main/cpp/libbun/external/libunwindstack-ndk/.clang-format

- name: Check Code Style
run: ./gradlew spotlessCheck

- name: Build and check
run: ./gradlew assembleDebug assembleDebugAndroidTest build check
run: ./gradlew assembleDebugAndroidTest build --profile

- name: Upload build profile
if: always()
uses: actions/upload-artifact@v4
with:
name: gradle-build-profile
path: build/reports/profile/
if-no-files-found: ignore

- name: Alignment script executable
run: chmod +x scripts/check_elf_alignment.sh
Expand Down Expand Up @@ -96,6 +106,9 @@ jobs:
]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download APK
uses: actions/download-artifact@v4
with:
Expand All @@ -106,30 +119,25 @@ jobs:
with:
name: ${{ matrix.test-apk }}

- name: Get Saucectl
run: curl -L https://saucelabs.github.io/saucectl/install | bash

- name: Install saucectl
uses: saucelabs/saucectl-run-action@v4
env:
GITHUB_TOKEN: ${{ github.token }}
with:
skip-run: true

- name: Run Saucectl
- name: Run saucectl
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
TEST_APP: ${{ matrix.test-apk }}
run: |
saucectl configure --username ${{ secrets.SAUCE_USERNAME }} --accessKey ${{ secrets.SAUCE_ACCESS_KEY }}
# recent real device
saucectl run espresso -c "" --name "From Github Actions" --app example-app-debug.apk --testApp ${{ matrix.test-apk }} --device name=".*,platformVersion=14" --region us-west-1
# newest Android version
saucectl run espresso -c "" --name "From Github Actions" --app example-app-debug.apk --testApp ${{ matrix.test-apk }} --emulator name="Android GoogleApi Emulator,platformVersion=15.0" --region us-west-1
# oldest Android version
saucectl run espresso -c "" --name "From Github Actions" --app example-app-debug.apk --testApp ${{ matrix.test-apk }} --emulator name="Android GoogleApi Emulator,platformVersion=9.0" --region us-west-1
# oldest real device (aiming for armv7 / 32bit)
saucectl run espresso -c "" --name "From Github Actions" --app example-app-debug.apk --testApp ${{ matrix.test-apk }} --device name=".*,platformVersion=9" --region us-west-1
# --device name=".*,platformVersion=6.0.1"
# --device name="Samsung_Galaxy_S20_FE_5G_backtrace_us"
# --device name="Samsung_Galaxy_S22_Ultra_5G_backtrace_us"
saucectl configure --username "$SAUCE_USERNAME" --accessKey "$SAUCE_ACCESS_KEY"
conc=$(curl -s -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" "https://api.eu-central-1.saucelabs.com/rest/v1.2/users/$SAUCE_USERNAME/concurrency")
ccy=$(printf '%s' "$conc" | jq -r '[.concurrency.organization.allowed.rds, .concurrency.organization.allowed.vms] | map(select(type=="number")) | min // 1' 2>/dev/null)
case "$ccy" in ''|*[!0-9]*) ccy=1 ;; esac
echo "Using --ccy $ccy"
saucectl run --ccy "$ccy" --retries 2

- name: Run morgue
run: |
Expand Down
26 changes: 26 additions & 0 deletions .sauce/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v1alpha
kind: espresso
sauce:
region: eu-central-1
espresso:
app: example-app-debug.apk
testApp: $TEST_APP
suites:
- name: "Android 14 - real device"
devices:
- name: ".*"
platformVersion: "14"
- name: "Android 15 - emulator"
emulators:
- name: "Android GoogleApi Emulator"
platformVersions:
- "15.0"
- name: "Android 9 - emulator"
emulators:
- name: "Android GoogleApi Emulator"
platformVersions:
- "9.0"
- name: "Android 9 - real device"
devices:
- name: ".*"
platformVersion: "9"
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import static org.junit.Assert.assertEquals;

import android.content.Context;
import androidx.lifecycle.Lifecycle;
import androidx.test.ext.junit.rules.ActivityScenarioRule;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
Expand Down Expand Up @@ -38,6 +39,8 @@ public class ExampleInstrumentedTest extends InstrumentedTest {
@Before
public void enableMetricsAndBreadcrumbs() {
BacktraceLogger.setLevel(LogLevel.DEBUG);
// Re-assert RESUMED: some old real devices background the activity right after launch.
mActivityRule.getScenario().moveToState(Lifecycle.State.RESUMED);
onView(withId(R.id.enableBreadcrumbs)).perform(click());
}

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1024m
org.gradle.jvmargs=-Xmx4g
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
org.gradle.parallel=true

GROUP=com.github.backtrace-labs.backtrace-android
POM_NAME=backtrace-library
Expand Down
Loading