Skip to content

ci: Flashlight integration github action #377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
pull_request:
branches:
- "*"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -49,3 +50,38 @@ jobs:
- name: Build Example app
working-directory: ./example
run: flutter build apk --target-platform android-arm,android-arm64,android-x64

- name: πŸ“¦ Upload APK Artifact
uses: actions/upload-artifact@v4
with:
name: apk-build
path: example/build/app/outputs/flutter-apk/app-release.apk
retention-days: 1

flashlight-test:
needs: build
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: πŸ“š Git Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: πŸ“š Download APK Artifact
uses: actions/download-artifact@v4
with:
name: apk-build
path: apk

- name: πŸ“‹ List Downloaded Files
run: ls -la apk/

- name: πŸ”§ Install Flashlight CLI
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): Consider pinning the Flashlight CLI installer version.

Pin the installer to a specific version to prevent unexpected CLI changes and ensure consistent, reproducible builds.

Suggested implementation:

          curl https://get.flashlight.dev/v1.2.3 | bash

If a different version should be used, update "v1.2.3" accordingly. Also, ensure that the pinned version is available and supported by the Flashlight CLI team.

run: |
curl https://get.flashlight.dev/ | bash
echo "$HOME/.flashlight/bin" >> $GITHUB_PATH

- name: πŸš€ Upload to Flashlight
env:
FLASHLIGHT_API_KEY: ${{ secrets.FLASHLIGHT_API_KEY }}
run: |
flashlight cloud --app apk/app-release.apk --test .maestro/launch_app.yaml --duration 10000 --testName launch_app --apiKey $FLASHLIGHT_API_KEY
5 changes: 5 additions & 0 deletions .maestro/launch_app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
appId: com.example.chart_attempt
---
- clearState
- launchApp
- assertVisible: Up
1 change: 1 addition & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:label="example"
android:name="${applicationName}"
Expand Down
Loading