-
Notifications
You must be signed in to change notification settings - Fork 321
82 lines (74 loc) · 2.66 KB
/
pr_ci.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
name: Pull Request Check
on:
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'
- '**.txt'
- 'renovate.json'
- '.editorconfig'
- '.gitignore'
- '.github/**'
- '.idea/**'
- '!.github/workflows/**'
jobs:
build:
name: Build CI (Pull Request)
runs-on: ubuntu-24.04
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_HARDLINK: "true"
CCACHE_BASEDIR: "${{ github.workspace }}"
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
submodules: 'true'
fetch-depth: 0
- name: Config submodules
run: |
git -C "libs/LSPlant" config "submodule.test/src/main/jni/external/lsprism.update" none
git -C "libs/LSPlant" config "submodule.test/src/main/jni/external/lsparself.update" none
git -C "libs/LSPlant" config "submodule.docs/doxygen-awesome-css.update" none
git -C "libs/mmkv/MMKV" config "submodule.Python/pybind11.update" none
git submodule foreach git submodule update --init --recursive
- name: set up JDK 17
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'adopt'
cache: gradle
- name: Install ccache
run: |
sudo apt install -y ccache ninja-build
ccache -o max_size=1G
ccache -o hash_dir=false
ccache -o hard_link=true
ccache -o compiler_check='%compiler% -dumpmachine; %compiler% -dumpversion'
ccache -zp
- name: Cache Native Build
uses: actions/[email protected]
with:
path: |
~/.cache/ccache
~/.ccache
app/build/.lto-cache
key: native-cache-${{ github.sha }}
restore-keys: native-cache-
- name: Setup SDK
run: |
echo "ANDROID_HOME=${ANDROID_HOME}"
echo "ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}"
mkdir -p "$ANDROID_HOME/licenses/"
echo > "$ANDROID_HOME/licenses/android-sdk-license"
echo -n 24333f8a63b6825ea9c5514f83c2829b004d1fee > "$ANDROID_HOME/licenses/android-sdk-license"
echo "sdk.dir=${ANDROID_HOME}" > local.properties
- name: Setup Gradle
uses: gradle/[email protected]
- name: Build with Gradle
run: |
echo 'org.gradle.parallel=true' >> gradle.properties
echo 'org.gradle.vfs.watch=true' >> gradle.properties
sed -i 's/org.gradle.configuration-cache=true//g' gradle.properties
./gradlew :app:packageDebug
ccache -s