-
Notifications
You must be signed in to change notification settings - Fork 27
82 lines (76 loc) · 2.89 KB
/
pr.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: Build CI (Pull Request)
on:
pull_request:
branches:
- main
paths-ignore:
- '**.md'
- '**.txt'
- '.github/**'
- '!.github/workflows/**'
- "TMessagesProj/src/main/res/values**/**"
jobs:
build:
name: Gradle Build
if: ${{ github.event_name == 'pull_request' && success() }}
runs-on: ubuntu-latest
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_MAXSIZE: "10G"
CCACHE_HARDLINK: "true"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Check out submodules
run: |
git -c submodule."libs/rust".update=none submodule update --init --recursive
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.22.1'
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/[email protected]
- name: Set up ccache
uses: hendrikmuhs/[email protected]
with:
key: ccache
restore-keys: ccache
- name: Setup Android SDK Tools
uses: android-actions/setup-android@v2
- name: Prepare Environment
run: |
echo "Removing large packages"
sudo apt-get remove -y '^dotnet-.*' aspnetcore-targeting-pack-6.0 aspnetcore-targeting-pack-7.0
sudo apt-get remove -y '^llvm-.*'
sudo apt-get remove -y 'php.*'
sudo apt-get remove -y '^mongodb-.*'
sudo apt-get remove -y '^mysql-.*'
sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri
sudo apt-get autoremove -y
sudo apt-get clean
echo "Removing large directories"
sudo rm -rf /usr/share/dotnet/
sudo rm -rf /usr/local/graalvm/
sudo rm -rf /usr/local/.ghcup/
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /usr/local/lib/node_modules
df -h
sudo apt-get install bison gcc make curl ninja-build ccache -y
echo "y" | sdkmanager --install "ndk;27.0.12077973" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
echo "sdk.dir=${ANDROID_HOME}" >> local.properties
- name: Debug Build
run: |
sed '/signingConfig =/d' TMessagesProj/build.gradle.kts > TMessagesProj/build.gradle.kts.tmp
sed '/google.services/d' TMessagesProj/build.gradle.kts.tmp > TMessagesProj/build.gradle.kts
sed '/google.services/d' build.gradle.kts > build.gradle.kts.tmp
cp build.gradle.kts.tmp build.gradle.kts
./gradlew TMessagesProj:assembleDebug