Skip to content

Commit 16017b6

Browse files
authored
Merge pull request #265 from ndtp/add_github_action_sample
Add a GitHub Action sample for Flix
2 parents f087f38 + fabc769 commit 16017b6

File tree

1 file changed

+28
-15
lines changed

1 file changed

+28
-15
lines changed

.github/workflows/flix_sample.yml

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
build:
1515
name: "Build APKs for testing"
16-
timeout-minutes: 25
16+
timeout-minutes: 10
1717
runs-on:
1818
labels: ubuntu-latest
1919

@@ -46,7 +46,7 @@ jobs:
4646

4747
screenshot_test:
4848
name: Run Screenshot Tests ${{ matrix.shard_index }}
49-
timeout-minutes: 25
49+
timeout-minutes: 10
5050
needs: build
5151
runs-on: ubuntu-latest
5252

@@ -58,11 +58,24 @@ jobs:
5858
steps:
5959
- uses: actions/checkout@v4
6060

61-
- name: Setup Java
62-
uses: actions/setup-java@v4
61+
- name: Create AVD
62+
id: create
63+
uses: ndtp/android-avd-manager-action@main
6364
with:
64-
distribution: "temurin"
65-
java-version: 21
65+
api-level: 29
66+
target: google_apis
67+
arch: x86_64
68+
profile: pixel_3a
69+
70+
- name: Enable kernel-based virtual machine (KVM)
71+
uses: ndtp/enable-kvm-action@v1
72+
73+
- name: Launch and configure emulator
74+
id: launch
75+
uses: ndtp/android-emulator-runner@main
76+
with:
77+
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim
78+
verbose: true
6679

6780
- name: Download app apk
6881
uses: actions/download-artifact@v4
@@ -84,19 +97,19 @@ jobs:
8497
run: |
8598
echo "test_apk=$(find ./Samples/Flix/build/outputs/apk/androidTest/debug/*.apk)" >> $GITHUB_ENV
8699
87-
- name: Screenshot Tests
88-
uses: ndtp/android-testify-action@v1
100+
- name: Run instrumentation tests
101+
uses: ndtp/android-instrumentation-test-runner@main
89102
with:
90-
api-level: 29
91-
target: google_apis
92-
arch: x86_64
93-
profile: pixel_3a
94-
shard_count: 2
95-
shard_index: ${{ matrix.shard_index }}
96-
module: ":FlixSample"
97103
app_apk: ${{ env.app_apk }}
98104
app_package: "dev.testify.samples.flix"
99105
test_apk: ${{ env.test_apk }}
100106
test_package: "dev.testify.samples.flix.test"
101107
test_runner: "androidx.test.runner.AndroidJUnitRunner"
108+
shard_count: 2
109+
shard_index: ${{ matrix.shard_index }}
110+
annotation: dev.testify.annotation.ScreenshotInstrumentation
102111
verbose: true
112+
113+
- name: Kill Emulator
114+
if: always()
115+
run: adb -s emulator-${{ steps.launch.outputs.emulator-port }} emu kill

0 commit comments

Comments
 (0)