forked from Adyen/adyen-react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (83 loc) · 2.48 KB
/
android_tests.yml
File metadata and controls
96 lines (83 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Test Android
on:
workflow_call:
inputs:
android-version:
required: false
default: 30
type: number
react-native-version:
required: false
default: '0.71.14'
type: string
jobs:
test-Android:
runs-on: macos-13
env:
target: google_apis
arch: x86
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
cache: 'yarn'
- uses: actions/cache/restore@v4
with:
path: lib
key: temp-lib-${{ github.sha }}
- uses: actions/cache/restore@v4
id: yarn-cache
with:
path: example\node_modules
key: temp-node-${{ github.sha }}
- name: Build dependency if needed
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ inputs.android-version }}
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ inputs.android-version }}
target: ${{ env.target }}
arch: ${{ env.arch }}
force-avd-creation: false
script: echo "Generated AVD snapshot for caching."
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ inputs.android-version }}
target: ${{ env.target }}
arch: ${{ env.arch }}
force-avd-creation: false
working-directory: ./example/android
script: |
echo "::group::Running Android app"
yarn android
echo "::endgroup::"
echo "::group::Running Tests"
./gradlew jacocoTestReport
echo "::endgroup::"
- name: Prepare Jacoco report
run: |
mkdir reports
mv $(find . -name 'jacocoTestReport.xml') reports/jacoco.xml
- name: Archive Coverage report
uses: actions/upload-artifact@v4
with:
name: kotlin-coverage-report
path: reports