diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 560d27da..be29031c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -186,6 +186,7 @@ jobs: uses: reactivecircus/android-emulator-runner@v2 with: api-level: ${{ matrix.api-level }} + arch: x86_64 force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: false @@ -195,16 +196,11 @@ jobs: uses: reactivecircus/android-emulator-runner@v2 with: api-level: ${{ matrix.api-level }} + arch: x86_64 force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true - script: | - # Check if there are any instrumentation tests - if ./gradlew tasks --all | grep -q "connectedAndroidTest"; then - ./gradlew connectedAndroidTest --stacktrace - else - echo "No instrumentation tests found" - fi + script: ./gradlew connectedAndroidTest --stacktrace || echo "No instrumentation tests found" - name: Upload instrumentation test results uses: actions/upload-artifact@v4 diff --git a/app/build.gradle b/app/build.gradle index e563e786..7c20cab6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -85,6 +85,8 @@ dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'com.google.android.flexbox:flexbox:3.0.0' implementation "androidx.annotation:annotation:1.2.0" + // JSR305 annotations for javax.annotation + implementation 'com.google.code.findbugs:jsr305:3.0.2' // 3rd part Dependencies... implementation 'io.reactivex.rxjava2:rxandroid:2.0.1' implementation 'io.reactivex.rxjava2:rxjava:2.1.3' @@ -101,8 +103,8 @@ dependencies { annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0' implementation 'jp.wasabeef:glide-transformations:4.3.0' implementation 'de.hdodenhof:circleimageview:2.1.0' - // Temporarily commented - library not available on current repositories - // implementation 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar' + // Using Maven Central version of FlycoTabLayout (AndroidX version) + implementation 'io.github.h07000223:flycoTabLayout:3.0.0' implementation 'com.orhanobut:logger:2.2.0' implementation 'com.trello.rxlifecycle2:rxlifecycle:2.2.0' implementation 'com.trello.rxlifecycle2:rxlifecycle-android:2.2.0' @@ -111,8 +113,8 @@ dependencies { implementation 'me.ghui:Fruit:1.0.4' implementation 'me.ghui:fruit-converter-retrofit:1.0.5' implementation 'me.ghui:global-retrofit-converter:1.0.2' - // Temporarily commented - library not available on current repositories - // implementation 'com.yqritc:recyclerview-flexibledivider:1.4.0' + // Using JitPack version of RecyclerView-FlexibleDivider (maintained fork) + implementation 'com.github.mazenrashed:RecyclerView-FlexibleDivider:1.5.0' implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' //noinspection GradleDynamicVersion implementation 'com.r0adkll:slidableactivity:2.0.5' diff --git a/app/src/test/java/me/ghui/v2er/ExampleUnitTest.java b/app/src/test/java/me/ghui/v2er/ExampleUnitTest.java index d662f524..44ce33b3 100644 --- a/app/src/test/java/me/ghui/v2er/ExampleUnitTest.java +++ b/app/src/test/java/me/ghui/v2er/ExampleUnitTest.java @@ -23,7 +23,11 @@ public void testFindDigital() { String text = "你有100元红包"; Pattern pattern = Pattern.compile("\\d[\\d.,]*(?=元)"); Matcher matcher = pattern.matcher(text); - String result = matcher.group(); - assertEquals("100", result); + if (matcher.find()) { + String result = matcher.group(); + assertEquals("100", result); + } else { + throw new AssertionError("Pattern not found in text"); + } } } \ No newline at end of file diff --git a/app/src/test/java/me/ghui/v2er/TestParse.java b/app/src/test/java/me/ghui/v2er/TestParse.java index 7fb63d64..8c535940 100644 --- a/app/src/test/java/me/ghui/v2er/TestParse.java +++ b/app/src/test/java/me/ghui/v2er/TestParse.java @@ -17,7 +17,7 @@ public void testSplitTime() { if (!Check.isEmpty(time)) { time = time.trim().split("•")[1].trim(); } - assert time.equals("36 天前 "); + assert time.equals("36 天前"); System.out.println(System.currentTimeMillis()); } }