@@ -11,43 +11,43 @@ concurrency:
1111
1212jobs :
1313
14- # build:
15- # name: "Build APKs for testing"
16- # timeout-minutes: 25
17- # runs-on:
18- # labels: ubuntu-latest
19-
20- # steps:
21- # - uses: actions/checkout@v4
22-
23- # - name: Setup Java
24- # uses: actions/setup-java@v4
25- # with:
26- # distribution: "temurin"
27- # java-version: 21
28-
29- # - name: Build
30- # run: |
31- # echo "Building ..."
32- # ./gradlew FlixSample:assembleDebug
33- # ./gradlew FlixSample:assembleDebugAndroidTest
34-
35- # - name: Upload app apk
36- # uses: actions/upload-artifact@v4
37- # with:
38- # name: android-app
39- # path: ./Samples/Flix/build/outputs/apk/debug/FlixSample-debug.apk
40-
41- # - name: Upload test runner apk
42- # uses: actions/upload-artifact@v4
43- # with:
44- # name: android-test-app
45- # path: ./Samples/Flix/build/outputs/apk/androidTest/debug/FlixSample-debug-androidTest.apk
14+ build :
15+ name : " Build APKs for testing"
16+ timeout-minutes : 25
17+ runs-on :
18+ labels : ubuntu-latest
19+
20+ steps :
21+ - uses : actions/checkout@v4
22+
23+ - name : Setup Java
24+ uses : actions/setup-java@v4
25+ with :
26+ distribution : " temurin"
27+ java-version : 21
28+
29+ - name : Build
30+ run : |
31+ echo "Building ..."
32+ ./gradlew FlixSample:assembleDebug
33+ ./gradlew FlixSample:assembleDebugAndroidTest
34+
35+ - name : Upload app apk
36+ uses : actions/upload-artifact@v4
37+ with :
38+ name : android-app
39+ path : ./Samples/Flix/build/outputs/apk/debug/FlixSample-debug.apk
40+
41+ - name : Upload test runner apk
42+ uses : actions/upload-artifact@v4
43+ with :
44+ name : android-test-app
45+ path : ./Samples/Flix/build/outputs/apk/androidTest/debug/FlixSample-debug-androidTest.apk
4646
4747 screenshot_test :
4848 name : Run Screenshot Tests ${{ matrix.shard_index }}
4949 timeout-minutes : 8
50- # needs: build
50+ needs : build
5151 runs-on : ubuntu-latest
5252
5353 strategy :
@@ -56,19 +56,11 @@ jobs:
5656 shard_index : [0]
5757
5858 steps :
59- - uses : actions/checkout@v4
60-
61- - name : Setup Java
62- uses : actions/setup-java@v4
63- with :
64- distribution : " temurin"
65- java-version : 21
6659
6760 - name : Create AVD
6861 id : create
6962 uses : ndtp/android-avd-manager-action@main
7063 with :
71- avd-name : baz
7264 api-level : 29
7365 target : google_apis
7466 arch : x86_64
@@ -81,54 +73,41 @@ jobs:
8173 id : launch
8274 uses : ndtp/android-emulator-runner@main
8375 with :
84- avd-name : baz
85- emulator-options : -camera-back emulated -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim
86- emulator-boot-timeout : 120
87- enable-hw-keyboard : true
88- disable-spellchecker : true
76+ emulator-options : -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim
8977 verbose : true
9078
91- - name : Test Emulator
92- id : output
93- run : adb devices
79+ - name : Download app apk
80+ uses : actions/download-artifact@v4
81+ with :
82+ name : android-app
83+ path : ./Samples/Flix/build/outputs/apk/debug/
9484
95- - name : Kill Emulator
96- run : adb -s emulator-${{ steps.launch.outputs.emulator-port }} emu kill
85+ - name : Determine apk path
86+ run : |
87+ echo "app_apk=$(find ./Samples/Flix/build/outputs/apk/debug/*.apk)" >> $GITHUB_ENV
9788
89+ - name : Download test runner apk
90+ uses : actions/download-artifact@v4
91+ with :
92+ name : android-test-app
93+ path : ./Samples/Flix/build/outputs/apk/androidTest/debug/
94+
95+ - name : Determine test apk path
96+ run : |
97+ echo "test_apk=$(find ./Samples/Flix/build/outputs/apk/androidTest/debug/*.apk)" >> $GITHUB_ENV
9898
99- # - name: Download app apk
100- # uses: actions/download-artifact@v4
101- # with:
102- # name: android-app
103- # path: ./Samples/Flix/build/outputs/apk/debug/
104-
105- # - name: Determine apk path
106- # run: |
107- # echo "app_apk=$(find ./Samples/Flix/build/outputs/apk/debug/*.apk)" >> $GITHUB_ENV
108-
109- # - name: Download test runner apk
110- # uses: actions/download-artifact@v4
111- # with:
112- # name: android-test-app
113- # path: ./Samples/Flix/build/outputs/apk/androidTest/debug/
114-
115- # - name: Determine test apk path
116- # run: |
117- # echo "test_apk=$(find ./Samples/Flix/build/outputs/apk/androidTest/debug/*.apk)" >> $GITHUB_ENV
118-
119- # - name: Screenshot Tests
120- # uses: ndtp/android-testify-action@test-nested-actions
121- # with:
122- # api-level: 29
123- # target: google_apis
124- # arch: x86_64
125- # profile: pixel_3a
126- # shard_count: 2
127- # shard_index: ${{ matrix.shard_index }}
128- # module: ":FlixSample"
129- # app_apk: ${{ env.app_apk }}
130- # app_package: "dev.testify.samples.flix"
131- # test_apk: ${{ env.test_apk }}
132- # test_package: "dev.testify.samples.flix.test"
133- # test_runner: "androidx.test.runner.AndroidJUnitRunner"
134- # verbose: true
99+ - name : Run instrumentation tests
100+ uses : ndtp/android-instrumentation-test-runner@main
101+ with :
102+ app_apk : ${{ env.app_apk }}
103+ app_package : " dev.testify.samples.flix"
104+ test_apk : ${{ env.test_apk }}
105+ test_package : " dev.testify.samples.flix.test"
106+ test_runner : " androidx.test.runner.AndroidJUnitRunner"
107+ shard_count : 1
108+ shard_index : ${{ matrix.shard_index }}
109+ annotation : dev.testify.annotation.ScreenshotInstrumentation
110+ verbose : true
111+
112+ - name : Kill Emulator
113+ run : adb -s emulator-${{ steps.launch.outputs.emulator-port }} emu kill
0 commit comments