-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add support for automatic screenshots (#961)
- Loading branch information
1 parent
167c4b8
commit 6fb77f4
Showing
13 changed files
with
356 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: "Android Screenshots Workflow" | ||
|
||
inputs: | ||
ANDROID_EMULATOR_API: | ||
description: 'Emulator API to be used when running tests' | ||
required: false | ||
default: 34 | ||
ANDROID_EMULATOR_ARCH: | ||
description: 'Emulator architecture to be used when running tests' | ||
required: false | ||
default: x86_64 | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Enable KVM group perms | ||
shell: bash | ||
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 | ||
- name: Cache AVD | ||
uses: actions/cache@v4 | ||
id: avd-cache | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-${{ inputs.ANDROID_EMULATOR_API }}-${{ inputs.ANDROID_EMULATOR_ARCH }} | ||
|
||
- name: Create AVD and Cache Snapshot | ||
if: steps.avd-cache.outputs.cache-hit != 'true' | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: ${{ inputs.ANDROID_EMULATOR_API }} | ||
arch: ${{ inputs.ANDROID_EMULATOR_ARCH }} | ||
profile: pixel_6 | ||
avd-name: pixel_6 | ||
force-avd-creation: false | ||
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
disable-animations: false | ||
script: echo "Generated AVD snapshot for caching." | ||
|
||
- name: Set up Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
cache: true | ||
|
||
- name: Create Android Screenshots | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: ${{ inputs.ANDROID_EMULATOR_API }} | ||
arch: ${{ inputs.ANDROID_EMULATOR_ARCH }} | ||
profile: pixel_6 | ||
avd-name: pixel_6 | ||
force-avd-creation: false | ||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
disable-animations: true | ||
script: | | ||
flutter drive --driver=test_integration/test_driver.dart --target=test_integration/screenshots.dart -d emulator | ||
- name: Upload Screenshots | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Android Screenshots | ||
path: screenshots/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,5 @@ app.*.map.json | |
/android/app/debug | ||
/android/app/profile | ||
/android/app/release | ||
|
||
screenshots/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.