-
Notifications
You must be signed in to change notification settings - Fork 110
131 lines (120 loc) · 4.83 KB
/
android.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Android CI
on:
push:
branches: ["main"]
paths:
- "**.gradle"
- "**.py"
- ".github/**"
- "emulator-testapp/**"
- "library/**"
- "fakelinker-test/**"
- "Stub/**"
tags:
- "v*"
pull_request:
branches: ["main"]
workflow_dispatch:
env:
BROWSER_TEST_MAX_DURATION: 600
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
cache: gradle
- name: Install store file
run: echo ${{ secrets.STORE_FILE }} | base64 -d > fake.jks
- name: Install build configuration
run: |
echo storeFile=`pwd`/fake.jks > local.properties
echo storePassword=${{ secrets.STORE_PASSWORD }} >> local.properties
echo keyAlias=${{ secrets.KEY_ALIAS }} >> local.properties
echo keyPassword=${{ secrets.KEY_PASSWORD }} >> local.properties
echo logLevel=3 >> local.properties
echo targetSdk=34 >> local.properties
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew -PmergeBuild=true -PemulatorBuild=false fakelinker-test:assembleDebug fakelinker-test:assembleDebugAndroidTest library:assembleDebug library:assembleRelease
- name: Copy output
run: |
mkdir -p out/test_binary out/test_apk
mv fakelinker-test/src/main/cpp/build/Debug out/test_binary
mv fakelinker-test/build/outputs/apk/debug/fakelinker-test-debug.apk out/test_apk/fakelinker-test-debug.apk
mv fakelinker-test/build/outputs/apk/androidTest/debug/fakelinker-test-debug-androidTest.apk out/test_apk/fakelinker-androidtest-debug-testsuite.apk
mv library/build/outputs/aar/library-debug.aar out/fakelinker-lib-debug.aar
mv library/build/outputs/aar/library-release.aar out/fakelinker-lib-release.aar
- name: Build emulator version with Gradle
run: |
rm -rf library/build/intermediates/merged_native_libs
./gradlew -PmergeBuild=true -PemulatorBuild=true emulator-testapp:assembleDebug library:assembleDebug library:assembleRelease
- name: Copy emulator version output
run: |
mv emulator-testapp/build/outputs/apk/debug/emulator-testapp-debug.apk out/test_apk/fakelinker-emulator-test-debug.apk
mv library/build/outputs/aar/library-debug.aar out/fakelinker-emulator-lib-debug.aar
mv library/build/outputs/aar/library-release.aar out/fakelinker-emulator-lib-release.aar
- name: Build 32-bit test app
run: |
rm -rf library/build/intermediates/merged_native_libs
rm -rf fakelinker-test/build/intermediates/merged_native_libs
echo "abis=armeabi-v7a,x86" >> local.properties
./gradlew fakelinker-test:assembleDebug
- name: Copy 32-bit test app
run: |
mv fakelinker-test/build/outputs/apk/debug/fakelinker-test-debug.apk out/test_apk/fakelinker-test-32bit-debug.apk
- name: Uninstall store file
run: rm -f fake.jks
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}-build
# A file, directory or wildcard pattern that describes what to upload
path: out
test_apk:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
pip install requests
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}-build
path: ./artifacts
- name: Run BrowerStack 64bit Test
run: |
python ./browser_stack_test.py test \
--apk artifacts/test_apk/fakelinker-test-debug.apk \
--test-suite artifacts/test_apk/fakelinker-androidtest-debug-testsuite.apk \
--apk-custom-id FakelinkerTestApp \
--test-suite-custom-id FakelinkerTestSuite \
--build-last-failed \
--all-api \
--device-log
env:
BROWSER_STACK_KEY: ${{ secrets.BROWSER_STACK_KEY }}
- name: Run BrowerStack 32bit Test
run: |
python ./browser_stack_test.py test \
--apk artifacts/test_apk/fakelinker-test-32bit-debug.apk \
--test-suite artifacts/test_apk/fakelinker-androidtest-debug-testsuite.apk \
--apk-custom-id FakelinkerTestApp \
--test-suite-custom-id FakelinkerTestSuite \
--build-last-failed \
--all-api \
--device-log \
--is-32bit
env:
BROWSER_STACK_KEY: ${{ secrets.BROWSER_STACK_KEY }}