mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
squash commit
This commit is contained in:
parent
b485a480cf
commit
93d922f075
5 changed files with 483 additions and 133 deletions
73
.github/workflows/android.yml
vendored
73
.github/workflows/android.yml
vendored
|
@ -17,20 +17,55 @@ concurrency:
|
|||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
||||
|
||||
env:
|
||||
TERMUX: v0.118.0
|
||||
KEY_POSTFIX: nextest+rustc-hash+adb+sshd+upgrade+XGB+inc15
|
||||
COMMON_EMULATOR_OPTIONS: -no-window -noaudio -no-boot-anim -camera-back none -gpu swiftshader_indirect
|
||||
EMULATOR_DISK_SIZE: 12GB
|
||||
EMULATOR_HEAP_SIZE: 2048M
|
||||
EMULATOR_BOOT_TIMEOUT: 1200 # 20min
|
||||
|
||||
jobs:
|
||||
test_android:
|
||||
name: Test builds
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 90
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest] # , macos-latest
|
||||
cores: [4] # , 6
|
||||
ram: [4096, 8192]
|
||||
api-level: [28]
|
||||
target: [default]
|
||||
arch: [x86, x86_64] # , arm64-v8a
|
||||
exclude:
|
||||
- ram: 8192
|
||||
arch: x86
|
||||
- ram: 4096
|
||||
arch: x86_64
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
TERMUX: v0.118.0
|
||||
EMULATOR_RAM_SIZE: ${{ matrix.ram }}
|
||||
EMULATOR_CORES: ${{ matrix.cores }}
|
||||
RUNNER_OS: ${{ matrix.os }}
|
||||
AVD_CACHE_KEY: "set later due to limitations of github actions not able to concatenate env variables"
|
||||
steps:
|
||||
- name: Concatenate values to environment file
|
||||
run: |
|
||||
echo "AVD_CACHE_KEY=${{ matrix.os }}-${{ matrix.cores }}-${{ matrix.ram }}-${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }}+termux-${{ env.TERMUX }}+${{ env.KEY_POSTFIX }}" >> $GITHUB_ENV
|
||||
- name: Collect information about runner
|
||||
run: |
|
||||
hostname
|
||||
uname -a
|
||||
free -mh
|
||||
df -h
|
||||
cat /proc/cpuinfo
|
||||
- name: Enable KVM group perms (linux hardware acceleration)
|
||||
if: ${{ runner.os == 'Linux' }}
|
||||
run: |
|
||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
||||
sudo udevadm control --reload-rules
|
||||
sudo udevadm trigger --name-match=kvm
|
||||
- uses: actions/checkout@v4
|
||||
- name: Restore AVD cache
|
||||
uses: actions/cache/restore@v4
|
||||
|
@ -41,7 +76,7 @@ jobs:
|
|||
~/.android/avd/*/snapshots/*
|
||||
~/.android/adb*
|
||||
~/__rustc_hash__
|
||||
key: avd-${{ matrix.api-level }}-${{ matrix.arch }}+termux-${{ env.TERMUX }}+nextest+rustc-hash
|
||||
key: avd-${{ env.AVD_CACHE_KEY }}
|
||||
- name: Delete AVD Lockfile when run from cache
|
||||
if: steps.avd-cache.outputs.cache-hit == 'true'
|
||||
run: |
|
||||
|
@ -50,15 +85,18 @@ jobs:
|
|||
~/.android/avd/*/*.lock
|
||||
- name: Create and cache emulator image
|
||||
if: steps.avd-cache.outputs.cache-hit != 'true'
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
uses: reactivecircus/android-emulator-runner@v2.30.1
|
||||
with:
|
||||
api-level: ${{ matrix.api-level }}
|
||||
target: ${{ matrix.target }}
|
||||
arch: ${{ matrix.arch }}
|
||||
ram-size: 2048M
|
||||
disk-size: 7GB
|
||||
ram-size: ${{ env.EMULATOR_RAM_SIZE }}
|
||||
heap-size: ${{ env.EMULATOR_HEAP_SIZE }}
|
||||
disk-size: ${{ env.EMULATOR_DISK_SIZE }}
|
||||
cores: ${{ env.EMULATOR_CORES }}
|
||||
force-avd-creation: true
|
||||
emulator-options: -no-window -no-snapshot-load -noaudio -no-boot-anim -camera-back none
|
||||
emulator-options: ${{ env.COMMON_EMULATOR_OPTIONS }} -no-snapshot-load
|
||||
emulator-boot-timeout: ${{ env.EMULATOR_BOOT_TIMEOUT }}
|
||||
script: |
|
||||
util/android-commands.sh init "${{ matrix.arch }}" "${{ matrix.api-level }}" "${{ env.TERMUX }}"
|
||||
- name: Save AVD cache
|
||||
|
@ -70,12 +108,12 @@ jobs:
|
|||
~/.android/avd/*/snapshots/*
|
||||
~/.android/adb*
|
||||
~/__rustc_hash__
|
||||
key: avd-${{ matrix.api-level }}-${{ matrix.arch }}+termux-${{ env.TERMUX }}+nextest+rustc-hash
|
||||
key: avd-${{ env.AVD_CACHE_KEY }}
|
||||
- uses: juliangruber/read-file-action@v1
|
||||
id: read_rustc_hash
|
||||
with:
|
||||
# ~ expansion didn't work
|
||||
path: /Users/runner/__rustc_hash__
|
||||
path: ${{ runner.os == 'Linux' && '/home/runner/__rustc_hash__' || '/Users/runner/__rustc_hash__' }}
|
||||
trim: true
|
||||
- name: Restore rust cache
|
||||
id: rust-cache
|
||||
|
@ -86,15 +124,18 @@ jobs:
|
|||
# the github cache during the development of this workflow
|
||||
key: ${{ matrix.arch }}_${{ matrix.target}}_${{ steps.read_rustc_hash.outputs.content }}_${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}_v3
|
||||
- name: Build and Test
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
uses: reactivecircus/android-emulator-runner@v2.30.1
|
||||
with:
|
||||
api-level: ${{ matrix.api-level }}
|
||||
target: ${{ matrix.target }}
|
||||
arch: ${{ matrix.arch }}
|
||||
ram-size: 2048M
|
||||
disk-size: 7GB
|
||||
ram-size: ${{ env.EMULATOR_RAM_SIZE }}
|
||||
heap-size: ${{ env.EMULATOR_HEAP_SIZE }}
|
||||
disk-size: ${{ env.EMULATOR_DISK_SIZE }}
|
||||
cores: ${{ env.EMULATOR_CORES }}
|
||||
force-avd-creation: false
|
||||
emulator-options: -no-window -no-snapshot-save -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -snapshot ${{ matrix.api-level }}-${{ matrix.arch }}+termux-${{ env.TERMUX }}
|
||||
emulator-options: ${{ env.COMMON_EMULATOR_OPTIONS }} -no-snapshot-save -snapshot ${{ env.AVD_CACHE_KEY }}
|
||||
emulator-boot-timeout: ${{ env.EMULATOR_BOOT_TIMEOUT }}
|
||||
# This is not a usual script. Every line is executed in a separate shell with `sh -c`. If
|
||||
# one of the lines returns with error the whole script is failed (like running a script with
|
||||
# set -e) and in consequences the other lines (shells) are not executed.
|
||||
|
@ -109,3 +150,9 @@ jobs:
|
|||
with:
|
||||
path: ~/__rust_cache__
|
||||
key: ${{ matrix.arch }}_${{ matrix.target}}_${{ steps.read_rustc_hash.outputs.content }}_${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}_v3
|
||||
- name: archive any output (error screenshots)
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test_output_${{ env.AVD_CACHE_KEY }}
|
||||
path: output
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue