Skip to content

Commit

Permalink
feat(ci): upgrade action android to reuse existing sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Malinskiy committed Jan 21, 2024
1 parent 30f2fb8 commit c8c1b09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions .buildsystem/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MAINTAINER Anton Malinskiy "[email protected]"
USER root

RUN apt-get update -y \
&& apt-get install -y --no-install-recommends git curl build-essential jq unzip rename openjdk-17-jdk \
&& apt-get install -y --no-install-recommends git curl build-essential jq unzip zip rename openjdk-17-jdk \
&& rm -rf /var/lib/apt/lists/*

ARG android_home=/opt/android-sdk
Expand Down Expand Up @@ -34,21 +34,16 @@ RUN sdkmanager \

ARG api
ARG abi=x86_64
RUN sdkmanager "system-images;android-${api};google_apis;${abi}" && \
RUN sdkmanager "system-images;android-${api};google_apis;${abi}" "platforms;android-${api}" && \
# Convert large partitions to qcow2 to save space
qemu-img convert -O qcow2 -c $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/system.img $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/system.qcow2 && \
mv $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/system.qcow2 $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/system.img && \
qemu-img convert -O qcow2 -c $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/userdata.img $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/userdata.qcow2 && \
mv $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/userdata.qcow2 $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/userdata.img && \
if test -f $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/vendor.img; then (qemu-img convert -O qcow2 -c $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/vendor.img $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/vendor.qcow2 && mv $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/vendor.qcow2 $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/vendor.img); fi

RUN sdkmanager "platforms;android-${api}"

ADD --chown=1001:1001 init.gradle.kts /home/runner/.gradle/

RUN chown -R 1001:1001 $ANDROID_HOME
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends zip \
&& rm -rf /var/lib/apt/lists/*

USER runner
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ jobs:
distribution: 'temurin'
java-version: '11'
- name: integration test
uses: malinskiy/action-android/emulator-run-cmd@release/0.1.4
uses: malinskiy/action-android/emulator-run-cmd@release/0.1.5
timeout-minutes: 25
with:
cmd: ./gradlew :adam:integrationTest
cmdOptions: -no-snapshot-save -noaudio -no-boot-anim -cores 2 -memory 3072 -no-window -gpu swiftshader_indirect -grpc 8554
cmdOptions: -no-snapshot-save -noaudio -no-boot-anim -cores 4 -memory 3072 -no-window -gpu swiftshader_indirect -grpc 8554
api: ${{ matrix.api }}
tag: google_apis
abi: x86_64
Expand Down

0 comments on commit c8c1b09

Please sign in to comment.