From 457e58190dca1ce11b18cf45a5ed803e046c8003 Mon Sep 17 00:00:00 2001 From: ramin-deriv Date: Mon, 20 Jan 2025 15:29:45 +0800 Subject: [PATCH] update workflow --- .github/workflows/performance_test.yaml | 33 ++++++++++++------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/performance_test.yaml b/.github/workflows/performance_test.yaml index 8ea43dab0..b0d1b2458 100644 --- a/.github/workflows/performance_test.yaml +++ b/.github/workflows/performance_test.yaml @@ -11,13 +11,20 @@ jobs: runs-on: ubuntu-latest steps: - + # Set Up Java - name: ☕ Set Up Java 17 uses: actions/setup-java@v3 with: java-version: '17' distribution: 'temurin' + # Verify Java Installation (Optional Debug Step) + - name: Verify Java Installation + run: | + java -version + echo $JAVA_HOME + + # Set Up Flutter - name: 🐦 Setup Flutter uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa with: @@ -26,53 +33,45 @@ jobs: cache: true cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} - # Step 1: Checkout master branch + # Checkout and Build Master Branch - name: Checkout master branch uses: actions/checkout@v3 with: ref: master path: master - # Step 2: Build example app for master branch - name: Build example app for master branch working-directory: ./master/example run: | flutter pub get flutter build apk --target-platform android-arm,android-arm64,android-x64 - env: - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 - # Step 3: Upload master APK - name: Upload Master APK uses: actions/upload-artifact@v3 with: name: master-example-apk path: master/example/build/app/outputs/flutter-apk/app-release.apk - # Step 4: Checkout PR branch + # Checkout and Build PR Branch - name: Checkout PR branch uses: actions/checkout@v3 with: ref: ${{ github.head_ref }} path: pr - # Step 5: Build example app for PR branch - name: Build example app for PR branch working-directory: ./pr/example run: | flutter pub get flutter build apk --target-platform android-arm,android-arm64,android-x64 - env: - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 - # Step 6: Upload PR APK - name: Upload PR APK uses: actions/upload-artifact@v3 with: name: pr-example-apk path: pr/example/build/app/outputs/flutter-apk/app-release.apk - # Step 7: Set up Android Emulator + # Set Up Android Emulator - name: Set up Android Emulator uses: reactivecircus/android-emulator-runner@v2 with: @@ -82,7 +81,7 @@ jobs: profile: Nexus_5X emulator-options: -no-window - # Step 8: Download APKs + # Download APKs - name: Download Master APK uses: actions/download-artifact@v3 with: @@ -95,24 +94,24 @@ jobs: name: pr-example-apk path: pr/ - # Step 9: Install Flashlight + # Install Flashlight - name: Install Flashlight run: | curl -sSL https://get.flashlight.dev | bash - # Step 10: Install and Test Master APK + # Install and Test Master APK - name: Install and Test Master APK run: | adb install master/app-release.apk flashlight test --bundleId com.example.master --testCommand "adb shell monkey -p com.example.master -c android.intent.category.LAUNCHER 1" --duration 10000 --resultsFilePath master_results.json - # Step 11: Install and Test PR APK + # Install and Test PR APK - name: Install and Test PR APK run: | adb install pr/app-release.apk flashlight test --bundleId com.example.pr --testCommand "adb shell monkey -p com.example.pr -c android.intent.category.LAUNCHER 1" --duration 10000 --resultsFilePath pr_results.json - # Step 12: Upload Flashlight Results + # Upload Flashlight Reports - name: Upload Flashlight Reports uses: actions/upload-artifact@v3 with: