mirror of
https://github.com/TeamAmaze/AmazeFileManager.git
synced 2026-10-16 20:51:21 +08:00
2b7ff5c8f5
Node20 will reach end-of-life (EOL) in April of 2026. As a result we have started the deprecation process of Node20 for GitHub Actions. We plan to migrate all actions to run on Node24 in the fall of 2026. https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
115 lines
3.4 KiB
YAML
115 lines
3.4 KiB
YAML
name: Android Build CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '*'
|
|
- '!master'
|
|
- '!release/*'
|
|
concurrency:
|
|
group: build-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
check_spotless:
|
|
name: Check spotless
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: "temurin"
|
|
java-version: 17
|
|
- name: Set up NDK
|
|
uses: nttld/setup-ndk@v1
|
|
with:
|
|
ndk-version: r28c
|
|
link-to-sdk: true
|
|
local-cache: true
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: stable
|
|
- name: Cache Rust dependencies
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
file_operations/target/
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-
|
|
- name: Setup Rust for Android
|
|
run: |
|
|
cd file_operations
|
|
chmod +x setup_rust_android.sh
|
|
./setup_rust_android.sh
|
|
- name: Verify Rust setup
|
|
run: |
|
|
cd file_operations
|
|
echo "🔍 Verifying Rust Android targets..."
|
|
rustup target list --installed | grep android || echo "No Android targets found"
|
|
echo "🔍 Verifying cargo configuration..."
|
|
if [ -f .cargo/config.toml ]; then
|
|
echo "✅ .cargo/config.toml exists"
|
|
else
|
|
echo "❌ .cargo/config.toml missing"
|
|
exit 1
|
|
fi
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v6
|
|
- name: Check formatting using spotless
|
|
run: ./gradlew spotlessCheck --stacktrace
|
|
|
|
build:
|
|
name: Build debug
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: "temurin"
|
|
java-version: 17
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: stable
|
|
- name: Cache Rust dependencies
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
file_operations/target/
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-
|
|
- name: Setup Rust for Android
|
|
run: |
|
|
cd file_operations
|
|
chmod +x setup_rust_android.sh
|
|
./setup_rust_android.sh
|
|
- name: Verify Rust setup
|
|
run: |
|
|
cd file_operations
|
|
echo "🔍 Verifying Rust Android targets..."
|
|
rustup target list --installed | grep android || echo "No Android targets found"
|
|
echo "🔍 Verifying cargo configuration..."
|
|
if [ -f .cargo/config.toml ]; then
|
|
echo "✅ .cargo/config.toml exists"
|
|
else
|
|
echo "❌ .cargo/config.toml missing"
|
|
exit 1
|
|
fi
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v6
|
|
- name: Build with Gradle
|
|
run: ./gradlew assembledebug --stacktrace
|