1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Merge pull request #5943 from cre4ture/fix/disk_space_issue_in_android_builds

`ci`: android disk space issue
This commit is contained in:
Daniel Hofstetter 2024-02-05 10:21:51 +01:00 committed by GitHub
commit dcb5c2ea97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,12 +54,24 @@ jobs:
run: | 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 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 - name: Collect information about runner
if: always()
continue-on-error: true
run: | run: |
hostname hostname
uname -a uname -a
free -mh free -mh
df -h df -Th
cat /proc/cpuinfo cat /proc/cpuinfo
- name: (Linux) create links from home to data partition
if: ${{ runner.os == 'Linux' }}
continue-on-error: true
run: |
ls -lah /mnt/
cat /mnt/DATALOSS_WARNING_README.txt
sudo mkdir /mnt/data
sudo chmod a+rwx /mnt/data
mkdir /mnt/data/.android && ln -s /mnt/data/.android ~/.android
mkdir /mnt/data/work && ln -s /mnt/data/work ~/work
- name: Enable KVM group perms (linux hardware acceleration) - name: Enable KVM group perms (linux hardware acceleration)
if: ${{ runner.os == 'Linux' }} if: ${{ runner.os == 'Linux' }}
run: | run: |
@ -67,9 +79,16 @@ jobs:
sudo udevadm control --reload-rules sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm sudo udevadm trigger --name-match=kvm
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Collect information about runner
if: always()
continue-on-error: true
run: |
free -mh
df -Th
- name: Restore AVD cache - name: Restore AVD cache
uses: actions/cache/restore@v4 uses: actions/cache/restore@v4
id: avd-cache id: avd-cache
continue-on-error: true
with: with:
path: | path: |
~/.android/avd/* ~/.android/avd/*
@ -77,6 +96,14 @@ jobs:
~/.android/adb* ~/.android/adb*
~/__rustc_hash__ ~/__rustc_hash__
key: avd-${{ env.AVD_CACHE_KEY }} key: avd-${{ env.AVD_CACHE_KEY }}
- name: Collect information about runner after AVD cache
if: always()
continue-on-error: true
run: |
free -mh
df -Th
ls -lah /mnt/data
du -sch /mnt/data
- name: Delete AVD Lockfile when run from cache - name: Delete AVD Lockfile when run from cache
if: steps.avd-cache.outputs.cache-hit == 'true' if: steps.avd-cache.outputs.cache-hit == 'true'
run: | run: |
@ -123,6 +150,12 @@ jobs:
# The version vX at the end of the key is just a development version to avoid conflicts in # The version vX at the end of the key is just a development version to avoid conflicts in
# the github cache during the development of this workflow # 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 key: ${{ matrix.arch }}_${{ matrix.target}}_${{ steps.read_rustc_hash.outputs.content }}_${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}_v3
- name: Collect information about runner ressources
if: always()
continue-on-error: true
run: |
free -mh
df -Th
- name: Build and Test - name: Build and Test
uses: reactivecircus/android-emulator-runner@v2.30.1 uses: reactivecircus/android-emulator-runner@v2.30.1
with: with:
@ -144,6 +177,12 @@ jobs:
util/android-commands.sh build util/android-commands.sh build
util/android-commands.sh tests util/android-commands.sh tests
if [[ "${{ steps.rust-cache.outputs.cache-hit }}" != 'true' ]]; then util/android-commands.sh sync_image; fi; exit 0 if [[ "${{ steps.rust-cache.outputs.cache-hit }}" != 'true' ]]; then util/android-commands.sh sync_image; fi; exit 0
- name: Collect information about runner ressources
if: always()
continue-on-error: true
run: |
free -mh
df -Th
- name: Save rust cache - name: Save rust cache
if: steps.rust-cache.outputs.cache-hit != 'true' if: steps.rust-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4 uses: actions/cache/save@v4
@ -156,3 +195,9 @@ jobs:
with: with:
name: test_output_${{ env.AVD_CACHE_KEY }} name: test_output_${{ env.AVD_CACHE_KEY }}
path: output path: output
- name: Collect information about runner ressources
if: always()
continue-on-error: true
run: |
free -mh
df -Th