Files
client/.gitea/workflows/android.yml
T
bit9992 2804788e9c
android-ci / android-arm64 (push) Failing after 2m16s
Fix Gitea runner workspace default for Android CI
2026-11-11 23:53:28 +03:00

149 lines
6.0 KiB
YAML

# Trusted mobile-branch pushes only; never execute fork pull requests on the shared runner.
# Installs occur only inside the disposable Ubuntu container. No releases or phone actions.
name: android-ci
on:
push:
branches: [feature/mobile-port]
workflow_dispatch:
inputs:
mode:
description: Build the test APK, or inspect resources only
required: true
default: build
type: choice
options: [build, inventory]
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
android-arm64:
runs-on: ubuntu-latest
container:
image: ubuntu:24.04
timeout-minutes: 360
env:
TARGET: aarch64-linux-android
EXPECTED_REVISION: ${{ github.sha }}
CI_RUN_ID: ${{ github.run_id }}
ANDROID_CI_PROVISION: container
CARGO_TERM_COLOR: never
CARGO_BUILD_JOBS: "1"
CARGO_TARGET_DIR: ${{ github.workspace }}/.android-ci/cargo-target
CMAKE_BUILD_PARALLEL_LEVEL: "1"
steps:
- name: Resource gate before checkout, cache restore or tool installation
id: resources
run: |
set -euo pipefail
test "$(uname -s)" = Linux
test "$(uname -m)" = x86_64
test -f /.dockerenv
printf 'Architecture: '; uname -m
printf 'CPU count: '; getconf _NPROCESSORS_ONLN
df -Pk . /
while IFS=: read -r key value; do
case "$key" in MemTotal|MemAvailable) printf '%s:%s\n' "$key" "$value" ;; esac
done < /proc/meminfo
if [ '${{ github.event.inputs.mode }}' = inventory ]; then exit 0; fi
for path in . /; do
free=$(df --output=avail -B1 "$path")
free=${free##*$'\n'}
if ! [[ "$free" =~ ^[[:space:]]*[0-9]+[[:space:]]*$ ]] || (( free < 107374182400 )); then
echo "BLOCKED: Android cold source build requires 100 GiB free on workspace and container root; no tools installed. Ask runner administrator for build storage."
exit 1
fi
done
available=0
while read -r key value unit; do if [ "$key" = MemAvailable: ]; then available=$value; fi; done < /proc/meminfo
if (( available < 8388608 )); then echo 'BLOCKED: at least 8 GiB available RAM required'; exit 1; fi
- name: Bootstrap utilities inside the disposable job container
if: ${{ github.event.inputs.mode != 'inventory' }}
run: |
set -euo pipefail
test -f /.dockerenv
test "$(id -u)" = 0
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends ca-certificates git nodejs python3 zstd
- uses: actions/checkout@v4
if: ${{ github.event.inputs.mode != 'inventory' }}
with:
clean: true
persist-credentials: false
- name: Restore isolated tool and Cargo cache
if: ${{ github.event.inputs.mode != 'inventory' }}
id: cache
uses: actions/cache/restore@v3
with:
path: |
.android-ci/tools/downloads
.android-ci/tools/rustup
.android-ci/tools/cargo
.android-ci/tools/android-sdk
.android-ci/tools/skia-m153-0.101.2
.android-ci/tools/gradle
.android-ci/cargo-target
key: android-arm64-v1-${{ hashFiles('.gitea/android-ci-tools.json', '.gitea/setup-android-ci.sh', 'Cargo.lock', 'rust-toolchain.toml', 'platform/android/gradle/wrapper/gradle-wrapper.properties') }}-${{ github.sha }}
restore-keys: |
android-arm64-v1-${{ hashFiles('.gitea/android-ci-tools.json', '.gitea/setup-android-ci.sh', 'Cargo.lock', 'rust-toolchain.toml', 'platform/android/gradle/wrapper/gradle-wrapper.properties') }}-
- name: Provision pinned Android tools in the job container
if: ${{ github.event.inputs.mode != 'inventory' }}
run: bash .gitea/setup-android-ci.sh
- name: Require exact revision and no production signing
if: ${{ github.event.inputs.mode != 'inventory' }}
run: |
set -euo pipefail
test "$(git rev-parse HEAD)" = "$EXPECTED_REVISION"
test ! -e dist/android
for name in TEAMSPEACH_ANDROID_KEYSTORE TEAMSPEACH_ANDROID_STORE_PASSWORD TEAMSPEACH_ANDROID_KEY_ALIAS TEAMSPEACH_ANDROID_KEY_PASSWORD; do
if [[ -v "$name" ]]; then echo 'Production signing environment forbidden in test CI'; exit 1; fi
done
cargo run --locked -p xtask -- check-version
cargo test --locked -p xtask
# Source provenance is regenerated and verified, never trusted from an Actions cache.
- name: Build pinned WebRTC dependencies with one Ninja job
if: ${{ github.event.inputs.mode != 'inventory' }}
run: cargo run --locked -p xtask -- deps --target "$TARGET" --llvm-dir "$LLVM_HOME" --jobs 1
- name: Build and verify full-feature test APK
if: ${{ github.event.inputs.mode != 'inventory' }}
run: bash .gitea/build-android-variant.sh harness
- name: Upload installable Android test APK and provenance
if: ${{ github.event.inputs.mode != 'inventory' }}
uses: actions/upload-artifact@v3
with:
name: android-harness-arm64-${{ github.sha }}
path: |
dist/android/harness/*-harness-test.apk
dist/android/harness/build-info.json
dist/android/harness/aarch64-linux-android/*.json
if-no-files-found: error
retention-days: 14
- name: Save verified build tool and Cargo cache
if: ${{ success() && github.event.inputs.mode != 'inventory' && steps.cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v3
with:
path: |
.android-ci/tools/downloads
.android-ci/tools/rustup
.android-ci/tools/cargo
.android-ci/tools/android-sdk
.android-ci/tools/skia-m153-0.101.2
.android-ci/tools/gradle
.android-ci/cargo-target
key: ${{ steps.cache.outputs.cache-primary-key }}