Compare commits
13 Commits
develop
...
feature/bm
Author | SHA1 | Date | |
---|---|---|---|
|
85eadd49de | ||
|
d2685526ea | ||
|
f1047eb961 | ||
|
07ef81a8d5 | ||
|
53cb4d2df9 | ||
|
a7187a4630 | ||
|
7fb5084a35 | ||
|
9955481f7f | ||
|
59c8d69bb2 | ||
|
6855d836a6 | ||
|
5d3e732a03 | ||
|
d446bfa9d3 | ||
|
9e6f615f1c |
44
.github/workflows/tests.yml
vendored
44
.github/workflows/tests.yml
vendored
@ -7,16 +7,14 @@ on:
|
||||
|
||||
# Enrich gradle.properties for CI/CD
|
||||
env:
|
||||
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false
|
||||
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4 --no-daemon
|
||||
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx4608m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false
|
||||
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4 --no-daemon -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: Runs all tests
|
||||
runs-on: buildjet-4vcpu-ubuntu-2204
|
||||
strategy:
|
||||
matrix:
|
||||
api-level: [28]
|
||||
## TMP runs-on: buildjet-4vcpu-ubuntu-2204
|
||||
runs-on: macos-latest
|
||||
# Allow all jobs on main and develop. Just one per PR.
|
||||
concurrency:
|
||||
group: ${{ github.ref == 'refs/heads/main' && format('unit-tests-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('unit-tests-develop-{0}', github.sha) || format('unit-tests-{0}', github.ref) }}
|
||||
@ -57,41 +55,15 @@ jobs:
|
||||
disableRateLimiting: true
|
||||
public_baseurl: "http://10.0.2.2:8080/"
|
||||
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@v2
|
||||
|
||||
- name: Run all the codecoverage tests at once
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
# continue-on-error: true
|
||||
with:
|
||||
api-level: ${{ matrix.api-level }}
|
||||
arch: x86
|
||||
profile: Nexus 5X
|
||||
target: playstore
|
||||
force-avd-creation: false
|
||||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||
disable-animations: true
|
||||
# emulator-build: 7425822
|
||||
script: |
|
||||
run: |
|
||||
./gradlew gatherGplayDebugStringTemplates $CI_GRADLE_ARG_PROPERTIES
|
||||
./gradlew unitTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES
|
||||
./gradlew instrumentationTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES
|
||||
./gradlew generateCoverageReport $CI_GRADLE_ARG_PROPERTIES
|
||||
# NB: continue-on-error marks steps.tests.conclusion = 'success' but leaves steps.tests.outcome = 'failure'
|
||||
### - name: Run all the codecoverage tests at once (retry if emulator failed)
|
||||
### uses: reactivecircus/android-emulator-runner@v2
|
||||
### if: always() && steps.tests.outcome == 'failure' # don't run if previous step succeeded.
|
||||
### with:
|
||||
### api-level: 28
|
||||
### arch: x86
|
||||
### profile: Nexus 5X
|
||||
### force-avd-creation: false
|
||||
### emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||
### disable-animations: true
|
||||
### emulator-build: 7425822
|
||||
### script: |
|
||||
### ./gradlew gatherGplayDebugStringTemplates $CI_GRADLE_ARG_PROPERTIES
|
||||
### ./gradlew unitTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES
|
||||
### ./gradlew instrumentationTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES
|
||||
### ./gradlew generateCoverageReport $CI_GRADLE_ARG_PROPERTIES
|
||||
|
||||
- name: Upload Integration Test Report Log
|
||||
uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
|
@ -197,7 +197,7 @@ def launchTask = getGradle()
|
||||
.toLowerCase()
|
||||
|
||||
if (launchTask.contains("coverage".toLowerCase())) {
|
||||
apply from: 'coverage.gradle'
|
||||
apply from: './tools/gradle/coverage.gradle'
|
||||
}
|
||||
|
||||
apply plugin: 'org.sonarqube'
|
||||
|
@ -19,6 +19,10 @@ android.enableJetifier=true
|
||||
android.jetifier.ignorelist=android-base-common,common
|
||||
android.useAndroidX=true
|
||||
|
||||
# Test settings
|
||||
# Ref: https://developer.android.com/studio/test/gradle-managed-devices#gmd-sharding
|
||||
# android.experimental.androidTest.numManagedDeviceShards=2
|
||||
|
||||
#Project Settings
|
||||
# Change debugPrivateData to true for debugging
|
||||
vector.debugPrivateData=false
|
||||
|
@ -1,3 +1,5 @@
|
||||
import com.android.build.api.dsl.ManagedVirtualDevice
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
@ -76,6 +78,45 @@ android {
|
||||
testOptions {
|
||||
// Comment to run on Android 12
|
||||
// execution 'ANDROIDX_TEST_ORCHESTRATOR'
|
||||
|
||||
// Ref: https://developer.android.com/studio/test/gradle-managed-devices
|
||||
managedDevices {
|
||||
devices {
|
||||
// Run test with ./gradlew pixel2api28GplayDebugAndroidTest
|
||||
pixel2api28(ManagedVirtualDevice) {
|
||||
// Use device profiles you typically see in Android Studio.
|
||||
device = "Pixel 2"
|
||||
// Use only API levels 27 and higher.
|
||||
apiLevel = 28
|
||||
// To include Google services, use "google". Else "aosp"
|
||||
systemImageSource = "google"
|
||||
}
|
||||
// Run test with ./gradlew pixel2api30GplayDebugAndroidTest
|
||||
pixel2api30(ManagedVirtualDevice) {
|
||||
// Use device profiles you typically see in Android Studio.
|
||||
device = "Pixel 2"
|
||||
// Use only API levels 27 and higher.
|
||||
apiLevel = 30
|
||||
// To include Google services, use "google". Else "aosp"
|
||||
systemImageSource = "google"
|
||||
}
|
||||
// Ref: https://developer.android.com/studio/test/gradle-managed-devices#gmd-atd
|
||||
// Run test with ./gradlew pixel2api30AtdGplayDebugAndroidTest
|
||||
// Warning: Screenshot tests that depend on hardware rendering currently aren't supported when using ATDs.
|
||||
pixel2api30Atd(ManagedVirtualDevice) {
|
||||
// Use device profiles you typically see in Android Studio.
|
||||
device = "Pixel 2"
|
||||
// ATDs currently support only API level 30.
|
||||
apiLevel = 30
|
||||
// You can also specify "google-atd" if you require Google Play Services, else "aosp-atd"
|
||||
systemImageSource = "google-atd"
|
||||
}
|
||||
|
||||
// there is also a way to create group of devices, but this is not necessary for now:
|
||||
// https://developer.android.com/studio/test/gradle-managed-devices#gmd-groups
|
||||
}
|
||||
}
|
||||
// On GitHub action, add: -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
@ -87,5 +87,6 @@ task unitTestsWithCoverage(type: GradleBuild) {
|
||||
task instrumentationTestsWithCoverage(type: GradleBuild) {
|
||||
startParameter.projectProperties.coverage = [enableTestCoverage: true]
|
||||
startParameter.projectProperties['android.testInstrumentationRunnerArguments.notPackage'] = 'im.vector.app.ui'
|
||||
tasks = [':vector-app:connectedGplayDebugAndroidTest', ':vector:connectedDebugAndroidTest', 'matrix-sdk-android:connectedDebugAndroidTest']
|
||||
// tasks = [':vector-app:pixel2api30AtdGplayDebugAndroidTest', ':vector:pixel2api30AtdDebugAndroidTest', 'matrix-sdk-android:pixel2api30AtdDebugAndroidTest']
|
||||
tasks = [':vector-app:pixel2api30GplayDebugAndroidTest', ':vector:pixel2api30DebugAndroidTest', 'matrix-sdk-android:pixel2api30DebugAndroidTest']
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
import com.android.build.OutputFile
|
||||
import com.android.build.api.dsl.ManagedVirtualDevice
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'com.google.firebase.appdistribution'
|
||||
@ -128,7 +129,7 @@ android {
|
||||
namespace "im.vector.application"
|
||||
// Due to a bug introduced in Android gradle plugin 3.6.0, we have to specify the ndk version to use
|
||||
// Ref: https://issuetracker.google.com/issues/144111441
|
||||
ndkVersion "21.3.6528147"
|
||||
// ndkVersion "21.3.6528147"
|
||||
|
||||
compileSdk versions.compileSdk
|
||||
|
||||
@ -211,6 +212,45 @@ android {
|
||||
|
||||
// Comment to run on Android 12
|
||||
// execution 'ANDROIDX_TEST_ORCHESTRATOR'
|
||||
|
||||
// Ref: https://developer.android.com/studio/test/gradle-managed-devices
|
||||
managedDevices {
|
||||
devices {
|
||||
// Run test with ./gradlew pixel2api28GplayDebugAndroidTest
|
||||
pixel2api28(ManagedVirtualDevice) {
|
||||
// Use device profiles you typically see in Android Studio.
|
||||
device = "Pixel 2"
|
||||
// Use only API levels 27 and higher.
|
||||
apiLevel = 28
|
||||
// To include Google services, use "google". Else "aosp"
|
||||
systemImageSource = "google"
|
||||
}
|
||||
// Run test with ./gradlew pixel2api30GplayDebugAndroidTest
|
||||
pixel2api30(ManagedVirtualDevice) {
|
||||
// Use device profiles you typically see in Android Studio.
|
||||
device = "Pixel 2"
|
||||
// Use only API levels 27 and higher.
|
||||
apiLevel = 30
|
||||
// To include Google services, use "google". Else "aosp"
|
||||
systemImageSource = "google"
|
||||
}
|
||||
// Ref: https://developer.android.com/studio/test/gradle-managed-devices#gmd-atd
|
||||
// Run test with ./gradlew pixel2api30AtdGplayDebugAndroidTest
|
||||
// Warning: Screenshot tests that depend on hardware rendering currently aren't supported when using ATDs.
|
||||
pixel2api30Atd(ManagedVirtualDevice) {
|
||||
// Use device profiles you typically see in Android Studio.
|
||||
device = "Pixel 2"
|
||||
// ATDs currently support only API level 30.
|
||||
apiLevel = 30
|
||||
// You can also specify "google-atd" if you require Google Play Services, else "aosp-atd"
|
||||
systemImageSource = "google-atd"
|
||||
}
|
||||
|
||||
// there is also a way to create group of devices, but this is not necessary for now:
|
||||
// https://developer.android.com/studio/test/gradle-managed-devices#gmd-groups
|
||||
}
|
||||
}
|
||||
// On GitHub action, add: -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
|
@ -1,3 +1,5 @@
|
||||
import com.android.build.api.dsl.ManagedVirtualDevice
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
@ -31,7 +33,7 @@ android {
|
||||
namespace "im.vector.app"
|
||||
// Due to a bug introduced in Android gradle plugin 3.6.0, we have to specify the ndk version to use
|
||||
// Ref: https://issuetracker.google.com/issues/144111441
|
||||
ndkVersion "21.3.6528147"
|
||||
// ndkVersion "21.3.6528147"
|
||||
|
||||
compileSdk versions.compileSdk
|
||||
|
||||
@ -65,6 +67,45 @@ android {
|
||||
|
||||
// Comment to run on Android 12
|
||||
// execution 'ANDROIDX_TEST_ORCHESTRATOR'
|
||||
|
||||
// Ref: https://developer.android.com/studio/test/gradle-managed-devices
|
||||
managedDevices {
|
||||
devices {
|
||||
// Run test with ./gradlew pixel2api28GplayDebugAndroidTest
|
||||
pixel2api28(ManagedVirtualDevice) {
|
||||
// Use device profiles you typically see in Android Studio.
|
||||
device = "Pixel 2"
|
||||
// Use only API levels 27 and higher.
|
||||
apiLevel = 28
|
||||
// To include Google services, use "google". Else "aosp"
|
||||
systemImageSource = "google"
|
||||
}
|
||||
// Run test with ./gradlew pixel2api30GplayDebugAndroidTest
|
||||
pixel2api30(ManagedVirtualDevice) {
|
||||
// Use device profiles you typically see in Android Studio.
|
||||
device = "Pixel 2"
|
||||
// Use only API levels 27 and higher.
|
||||
apiLevel = 30
|
||||
// To include Google services, use "google". Else "aosp"
|
||||
systemImageSource = "google"
|
||||
}
|
||||
// Ref: https://developer.android.com/studio/test/gradle-managed-devices#gmd-atd
|
||||
// Run test with ./gradlew pixel2api30AtdGplayDebugAndroidTest
|
||||
// Warning: Screenshot tests that depend on hardware rendering currently aren't supported when using ATDs.
|
||||
pixel2api30Atd(ManagedVirtualDevice) {
|
||||
// Use device profiles you typically see in Android Studio.
|
||||
device = "Pixel 2"
|
||||
// ATDs currently support only API level 30.
|
||||
apiLevel = 30
|
||||
// You can also specify "google-atd" if you require Google Play Services, else "aosp-atd"
|
||||
systemImageSource = "google-atd"
|
||||
}
|
||||
|
||||
// there is also a way to create group of devices, but this is not necessary for now:
|
||||
// https://developer.android.com/studio/test/gradle-managed-devices#gmd-groups
|
||||
}
|
||||
}
|
||||
// On GitHub action, add: -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
|
||||
}
|
||||
buildTypes {
|
||||
debug {
|
||||
@ -266,7 +307,7 @@ dependencies {
|
||||
|
||||
// Excludes the legacy support library annotation usages
|
||||
// https://github.com/dm77/barcodescanner/blob/d036996c8a6f36a68843ffe539c834c28944b2d5/core/src/main/java/me/dm7/barcodescanner/core/CameraWrapper.java#L4
|
||||
implementation ('me.dm7.barcodescanner:zxing:1.9.13') {
|
||||
implementation('me.dm7.barcodescanner:zxing:1.9.13') {
|
||||
exclude group: 'com.android.support', module: 'support-v4'
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user