-
Notifications
You must be signed in to change notification settings - Fork 320
66 lines (59 loc) · 1.91 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
name: Pull Request Check
on:
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'
- '**.txt'
- '.github/**'
- '!.github/workflows/**'
jobs:
build:
name: Build CI (Pull Request)
runs-on: ubuntu-latest
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_HARDLINK: "true"
CCACHE_BASEDIR: "${{ github.workspace }}"
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
submodules: 'recursive'
fetch-depth: 0
- name: set up JDK 17
uses: actions/setup-java@v3.12.0
with:
java-version: '17'
distribution: 'adopt'
cache: gradle
- name: Install ccache
run: |
sudo apt install -y ccache
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/cache@v3.3.1
with:
path: |
~/.cache/ccache
~/.ccache
app/build/.lto-cache
key: native-cache-${{ github.sha }}
restore-keys: native-cache-
- name: Setup cmake
run: |
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "cmake;3.22.1" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
echo "sdk.dir=${ANDROID_HOME}" > local.properties
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.8.0
- 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