Skip to content

Commit

Permalink
Feat - Added Product Screenshot Testing (#1123)
Browse files Browse the repository at this point in the history
* Feat - Added Product Screenshot Testing

- Close #1122
- Close #1109

* Fixed Android Test Issue
  • Loading branch information
niyajali authored Oct 19, 2024
1 parent e248546 commit a38d8d1
Show file tree
Hide file tree
Showing 53 changed files with 27,483 additions and 29,188 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/NightlyBaselineProfiles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: NightlyBaselineProfiles

on:
schedule:
- cron: '40 3 * * 6'
workflow_dispatch:
inputs:
reason:
description: 'Reason for manual trigger'
required: false
default: 'Manual build requested'

jobs:
baseline_profiles:
name: "Generate Baseline Profiles"
runs-on: ubuntu-latest

permissions:
contents: write

timeout-minutes: 60

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

- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
ls /dev/kvm
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Accept licenses
run: yes | sdkmanager --licenses || true

- name: Check build-logic
run: ./gradlew check -p build-logic

- name: Setup GMD
run: ./gradlew :benchmarks:pixel6Api33Setup
--info
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"

- name: Build all build type and flavor permutations including baseline profiles
run: ./gradlew :app:assemble
-Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=baselineprofile
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
17 changes: 11 additions & 6 deletions .github/workflows/internal_or_beta_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,12 @@ jobs:

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
validate-wrappers: true

- name: Install GMD image for baseline profile generation
run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager "system-images;android-33;aosp_atd;x86_64"
- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Accept Android licenses
run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --licenses || true
- name: Accept licenses
run: yes | sdkmanager --licenses || true

- uses: ./.github/actions/create-release-number
name: 🔧 Create Release Number
Expand All @@ -87,6 +85,12 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup GMD
run: ./gradlew :benchmarks:pixel6Api33Setup
--info
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"

- name: 🔧 Build Release
id: build_release
env:
Expand Down Expand Up @@ -171,6 +175,7 @@ jobs:

- name: 🤖 Prepare Amazon Listing
if: github.event.inputs.release_type == 'beta' && github.event.inputs.amazon == 'true'
continue-on-error: true
run: bundle exec fastlane prep_amazon
env:
AMAZON_APPSTORE_CLIENT_ID: ${{ secrets.AMAZON_APPSTORE_CLIENT_ID }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/weekly_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ jobs:
ref: 'main',
inputs: {
"release_type": "beta",
"amazon": "false",
"amazon": "true",
},
})
2 changes: 1 addition & 1 deletion app/prodRelease-badging.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package: name='com.niyaj.poposroom' versionCode='1' versionName='0.0.1-beta.0.1' platformBuildVersionName='14' platformBuildVersionCode='34' compileSdkVersion='34' compileSdkVersionCodename='14'
package: name='com.niyaj.poposroom' versionCode='1' versionName='2024.9.3-beta.0.1' platformBuildVersionName='14' platformBuildVersionCode='34' compileSdkVersion='34' compileSdkVersionCodename='14'
sdkVersion:'26'
targetSdkVersion:'34'
uses-permission: name='android.permission.FOREGROUND_SERVICE'
Expand Down
13,917 changes: 6,678 additions & 7,239 deletions app/src/demoRelease/generated/baselineProfiles/baseline-prof.txt

Large diffs are not rendered by default.

13,917 changes: 6,678 additions & 7,239 deletions app/src/demoRelease/generated/baselineProfiles/startup-prof.txt

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
android:maxSdkVersion="28"
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<permission
android:name="com.niyaj.poposroom.demo.BENCHMARK_PERMISSION"
android:protectionLevel="signature" />

<application
android:allowBackup="true"
android:appCategory="productivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ import com.niyaj.employeePayment.destinations.AddEditPaymentScreenDestination
import com.niyaj.employeePayment.destinations.PaymentScreenDestination
import com.niyaj.feature.home.HomeScreen
import com.niyaj.feature.home.destinations.HomeScreenDestination
import com.niyaj.feature.product.destinations.ProductDetailsScreenDestination
import com.niyaj.feature.product.details.ProductDetailsScreen
import com.niyaj.feature.reports.ReportScreen
import com.niyaj.feature.reports.destinations.ReportScreenDestination
import com.niyaj.order.OrderScreen
import com.niyaj.order.destinations.OrderDetailsScreenDestination
import com.niyaj.order.destinations.OrderScreenDestination
import com.niyaj.order.details.OrderDetailsScreen
import com.niyaj.poposroom.ui.PoposAppState
import com.niyaj.product.destinations.ProductDetailsScreenDestination
import com.niyaj.product.details.ProductDetailsScreen
import com.ramcosta.composedestinations.DestinationsNavHost
import com.ramcosta.composedestinations.animations.defaults.NestedNavGraphDefaultAnimations
import com.ramcosta.composedestinations.animations.defaults.RootNavGraphDefaultAnimations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ import com.niyaj.employeePayment.EmployeepaymentNavGraph
import com.niyaj.expenses.ExpensesNavGraph
import com.niyaj.feature.home.HomeNavGraph
import com.niyaj.feature.market.MarketNavGraph
import com.niyaj.feature.product.ProductNavGraph
import com.niyaj.feature.reports.ReportsNavGraph
import com.niyaj.order.OrderNavGraph
import com.niyaj.printerInfo.PrinterinfoNavGraph
import com.niyaj.product.ProductNavGraph
import com.niyaj.profile.ProfileNavGraph
import com.niyaj.settings.SettingsNavGraph
import com.ramcosta.composedestinations.spec.DestinationSpec
Expand Down
Loading

0 comments on commit a38d8d1

Please sign in to comment.