Skip to content

Fix: CI

Fix: CI #337

Workflow file for this run

name: Build CI (Pull Request)
on:
pull_request:
branches:
- master
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-24.04
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_MAXSIZE: "10G"
CCACHE_HARDLINK: "true"
steps:
- uses: actions/checkout@v4
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/actions-setup-cmake@v2
with:
cmake-version: '3.22.1'
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Set up ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ccache
restore-keys: ccache
- name: Setup Android SDK Tools
uses: android-actions/setup-android@v3
- name: Prepare Environment
run: |
echo "Removing large packages"
sudo apt-get remove -y '^dotnet-.*'
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
export ndkversion="27.0.12077973"
sudo apt-get install wget bison gcc make curl ninja-build -y
echo "y" | sdkmanager --install "ndk;$ndkversion" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
wget https://github.com/qwq233/ollvm-bin/releases/download/18.0.0/clang-18 -O ${ANDROID_SDK_ROOT}/ndk/$ndkversion/toolchains/llvm/prebuilt/linux-x86_64/bin/oclang
chmod +x ${ANDROID_SDK_ROOT}/ndk/$ndkversion/toolchains/llvm/prebuilt/linux-x86_64/bin/oclang
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