1
- name : commit ci
1
+ name : Commit
2
2
on : [push]
3
+
3
4
env :
4
5
CI_NAME : Commit CI
5
6
jobs :
6
7
build :
7
- runs-on : ubuntu-latest
8
+ runs-on : ${{ matrix.os }}
9
+ strategy :
10
+ matrix :
11
+ os :
12
+ - ubuntu-22.04
13
+ - macos-13
14
+ - windows-2022
8
15
steps :
9
- - name : Checkout
10
- uses : actions/checkout@v3
16
+ - name : Fetch source code
17
+ uses : actions/checkout@v4
11
18
with :
12
19
fetch-depth : 0
13
20
19
26
20
27
- name : Calculate JNI cache hash
21
28
id : cache-hash
29
+ shell : bash
22
30
run : script/cache-hash.sh
23
31
24
32
- name : Fetch JNI cache
@@ -44,29 +52,37 @@ jobs:
44
52
- name : Setup Android SDK
45
53
uses : android-actions/setup-android@v3
46
54
47
- - name : Install dependency
48
- run : ./script/dependency.sh
55
+ - name : Install Android NDK
56
+ run : |
57
+ sdkmanager --install "cmake;3.22.1"
58
+
59
+ - name : Setup Gradle
60
+ uses : gradle/gradle-build-action@v2
49
61
50
- - name : Build Trime
51
- run : make debug
62
+ # `make debug` works not well on Windows
63
+ - name : Build Debug APK
64
+ run : |
65
+ ./gradlew spotlessCheck
66
+ ./gradlew :app:assembleDebug
52
67
53
68
- name : Add JNI cache
54
69
if : ${{ !steps.jni-cache.outputs.cache-hit }}
70
+ shell : bash
55
71
run : cp -R app/build/intermediates/stripped_native_libs/debug/out/lib app/prebuilt
56
72
57
- - name : Upload Trime artifact
73
+ - name : Upload APK artifact
58
74
uses : actions/upload-artifact@v3
59
75
with :
60
- name : trime
61
- path : app/build/outputs/apk/**/*.apk
76
+ name : trime-${{ matrix.os }}
77
+ path : app/build/outputs/apk/debug/
62
78
# keep 90 days
63
79
retention-days : 90
64
80
65
- - name : Upload Trime artifact (ARM64_V8A only)
81
+ - name : Upload APK artifact (ARM64_V8A only)
66
82
uses : actions/upload-artifact@v3
67
83
with :
68
- name : trime_arm64_v8a
69
- path : app/build/outputs/apk/** /*arm64-v8a-*.apk
84
+ name : trime-arm64-v8a-${{ matrix.os }}
85
+ path : app/build/outputs/apk/debug /*arm64-v8a-*.apk
70
86
# keep 90 days
71
87
retention-days : 90
72
88
0 commit comments