-
Notifications
You must be signed in to change notification settings - Fork 12
75 lines (73 loc) · 2.42 KB
/
pr-check.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
name: Check and build for pull requests
on: pull_request
jobs:
install-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Setup caching
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
key: cache-${{ runner.OS }}-${{ hashFiles('**/*.lock') }}
restore-keys: |
cache-${{ runner.OS }}-
- name: Install dependencies
run: |
yarn
- name: Run tests
run: |
yarn workspace @thu-info/app lint
yarn workspace @thu-info/app test
build-android:
needs: install-and-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "corretto"
java-version: "17"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Setup caching
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
key: cache-${{ runner.OS }}-${{ hashFiles('**/*.lock') }}
restore-keys: |
cache-${{ runner.OS }}-
- name: Install dependencies
run: |
yarn
- name: Prepare for building
run: |
sed -i "s/signingConfigs\.release/signingConfigs\.debug/g" apps/thu-info-app/android/app/build.gradle
sed -i "/preventRoot/d" apps/thu-info-app/android/app/src/main/java/com/unidy2002/thuinfo/MainApplication.kt
sed -i "/preventEmulator/d" apps/thu-info-app/android/app/src/main/java/com/unidy2002/thuinfo/MainApplication.kt
sed -i "/verifySignature/d" apps/thu-info-app/android/app/src/main/java/com/unidy2002/thuinfo/MainApplication.kt
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
build-root-directory: apps/thu-info-app/android
- name: Build android release
env:
SIGNATURE_DIGEST: ""
run: |
cd apps/thu-info-app/android && ./gradlew assembleRelease && cd ../../..
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: app-release.apk
path: apps/thu-info-app/android/app/build/outputs/apk/release/app-release.apk