Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ramin-deriv committed Jan 20, 2025
1 parent 0c38f0a commit 457e581
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/performance_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 457e581

Please sign in to comment.