-
Notifications
You must be signed in to change notification settings - Fork 54
131 lines (114 loc) · 4.36 KB
/
main.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:
- master
- dev**
pull_request:
branches:
- master
- dev**
jobs:
build_and_upload_artifacts:
name: Generate APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: corretto
- name: Setup Gradle Cache
uses: gradle/gradle-build-action@v2
- name: Restore Native Libs
id: restore-nativeLibs
uses: actions/cache@v3
with:
path: |
nativeLibs/djvu
nativeLibs/mupdf
nativeLibs/mupdfModule/build
nativeLibs/mupdfModule/.cxx
nativeLibs/djvuModule/build
nativeLibs/djvuModule/.cxx
key: ${{ runner.os }}-native-libs-${{ hashFiles('thirdparty_build.gradle') }}
- name: Prepare thirdparty
run: bash ./gradlew -b thirdparty_build.gradle downloadAndPatchDjvu downloadAndMakeMupdf
if: steps.restore-nativeLibs.outputs.cache-hit != 'true'
- name: Build debug APK
run: bash ./gradlew assembleDebug --stacktrace -Porion.CIBuild=true
- name: Read value from Properties-file
id: read_version_property
uses: christian-draeger/[email protected]
with:
path: './orion-viewer/version.properties'
property: 'orion.version.name'
- name: Upload arm7 APK
uses: actions/upload-artifact@v3
with:
name: orion-viewer-${{steps.read_version_property.outputs.value}}-${{github.run_number}}-armeabi-v7a-debug.apk
path: orion-viewer/build/outputs/apk/debug/orion-viewer-*-v7a-debug.apk
- name: Upload arm64 APK
uses: actions/upload-artifact@v3
with:
name: orion-viewer-${{steps.read_version_property.outputs.value}}-${{github.run_number}}-arm64-v8a-debug.apk
path: orion-viewer/build/outputs/apk/debug/orion-viewer-*-v8a-debug.apk
- name: Upload x86 APK
uses: actions/upload-artifact@v3
with:
name: orion-viewer-${{steps.read_version_property.outputs.value}}-${{github.run_number}}-x86-debug.apk
path: orion-viewer/build/outputs/apk/debug/orion-viewer-*-x86-debug.apk
- name: Upload x86_64 APK
uses: actions/upload-artifact@v3
with:
name: orion-viewer-${{steps.read_version_property.outputs.value}}-${{github.run_number}}-x86_64-debug.apk
path: orion-viewer/build/outputs/apk/debug/orion-viewer-*-x86_64-debug.apk
test:
env:
ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL: 170
strategy:
matrix:
arch: [[16, x86], [21, x86], [23, x86], [28, x86], [29, x86_64], [31, x86_64], [32, x86_64], [33, x86_64]]
os: [macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: corretto
- name: Setup Gradle Cache
uses: gradle/gradle-build-action@v2
- name: Restore Native Libs 2
id: restore-nativeLibs
uses: actions/cache@v3
with:
path: |
nativeLibs/djvu
nativeLibs/mupdf
nativeLibs/mupdfModule/build
nativeLibs/mupdfModule/.cxx
nativeLibs/djvuModule/build
key: ${{ runner.os }}-native-libs-${{ hashFiles('thirdparty_build.gradle') }}
- name: Prepare thirdparty
run: bash ./gradlew -b thirdparty_build.gradle downloadAndPatchDjvu downloadAndMakeMupdf
if: steps.restore-nativeLibs.outputs.cache-hit != 'true'
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.arch[0] }}
arch: ${{ matrix.arch[1] }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
sdcard-path-or-size: 900M
script: ./gradlew connectedDebugAndroidTest -Porion.CIBuild=true
- name: Test Summary
uses: test-summary/action@v2
with:
paths: orion-viewer/build/outputs/androidTest-results/connected/TEST-*.xml
if: always()