-
Notifications
You must be signed in to change notification settings - Fork 8
107 lines (90 loc) · 3.04 KB
/
android-detox-automation.yml
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
97
98
99
100
101
102
103
104
105
106
107
# .github/workflows/e2e-android.yml
name: e2e-android
on: push
jobs:
e2e-android:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Free Disk Space
run: |
sudo rm -rf /opt/hostedtoolcache
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
- name: Enable KVM
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: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
# cache: 'npm'
# cache-dependency-path: '**/package-lock.json'
- name: Install dependencies
run: npm install
- name: Create .env file
run: |
touch .env
echo ${{ secrets.HYPERSWITCH_PUBLISHABLE_KEY }}
echo STATIC_DIR = ./dist >> .env
echo HYPERSWITCH_PUBLISHABLE_KEY = ${{ secrets.HYPERSWITCH_PUBLISHABLE_KEY }}>> .env
echo HYPERSWITCH_SECRET_KEY = ${{ secrets.HYPERSWITCH_SECRET_KEY }}>> .env
- name: Start server
run: |
nohup node server.js &
- name: Check Server
run: |
curl http://localhost:5252/create-payment-intent
- name: Setup Java
uses: actions/setup-java@v3
with:
cache: gradle
distribution: temurin
java-version: 17
- name: Cache Detox build
id: cache-detox-build
uses: actions/cache@v3
with:
path: android/app/build
key: ${{ runner.os }}-detox-build
restore-keys: |
${{ runner.os }}-detox-build
- name: List branches
run: |
cd android
git fetch --all
git branch -r
- name: Checkout Android Repo
uses: actions/checkout@v4
with:
repository: juspay/hyperswitch-sdk-android
ref: detox-poc
path: android
fetch-depth: 0
- name: Detox build
run: cd android && ls && cd .. && npx detox build --configuration android.emu.ci.debug
- name: Get device name
id: device
run: node -e "console.log('AVD_NAME=' + require('./.detoxrc').devices.ciEmulator.device.avdName)" >> $GITHUB_OUTPUT
- name: Check Android branch
run: |
cd android && git branch && cd ..
- name: Detox test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 30
target: default
arch: x86_64
profile: pixel
avd-name: ${{ steps.device.outputs.AVD_NAME }}
script: npx detox test --configuration android.emu.ci.debug --headless --loglevel trace --record-logs all
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: detox-artifacts
path: artifacts