Skip to content

Commit

Permalink
Merge pull request #5943 from cre4ture/fix/disk_space_issue_in_androi…
Browse files Browse the repository at this point in the history
…d_builds

`ci`: android disk space issue
  • Loading branch information
cakebaker committed Feb 5, 2024
2 parents c1c2613 + db63e68 commit dcb5c2e
Showing 1 changed file with 47 additions and 2 deletions.
49 changes: 47 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,35 +54,62 @@ jobs:
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
if: always()
continue-on-error: true
run: |
hostname
uname -a
free -mh
df -h
df -Th
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)
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: Collect information about runner
if: always()
continue-on-error: true
run: |
free -mh
df -Th
- name: Restore AVD cache
uses: actions/cache/restore@v4
id: avd-cache
continue-on-error: true
with:
path: |
~/.android/avd/*
~/.android/avd/*/snapshots/*
~/.android/adb*
~/__rustc_hash__
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
if: steps.avd-cache.outputs.cache-hit == 'true'
run: |
rm -f \
~/.android/avd/*.avd/*.lock \
~/.android/avd/*/*.lock
~/.android/avd/*/*.lock
- name: Create and cache emulator image
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2.30.1
Expand Down Expand Up @@ -123,6 +150,12 @@ jobs:
# 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
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
uses: reactivecircus/android-emulator-runner@v2.30.1
with:
Expand All @@ -144,6 +177,12 @@ jobs:
util/android-commands.sh build
util/android-commands.sh tests
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
if: steps.rust-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
Expand All @@ -156,3 +195,9 @@ jobs:
with:
name: test_output_${{ env.AVD_CACHE_KEY }}
path: output
- name: Collect information about runner ressources
if: always()
continue-on-error: true
run: |
free -mh
df -Th

0 comments on commit dcb5c2e

Please sign in to comment.