Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Convert action into a single step with group markers
  • Loading branch information
mhsmith committed Aug 3, 2025
commit bd876f47f46baf8b0603950cf5f858930440c9fe
82 changes: 49 additions & 33 deletions .github/actions/build-android/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,58 @@ runs:
using: composite

steps:
# Build Python, and package it into a release artifact.
# The steps of a composite action are not clearly divided in the GitHub
# UI, so use a single step with ::group:: markers instead.
- shell: bash
run: ./Android/android.py build ${{ inputs.triplet }}
- shell: bash
run: ./Android/android.py package ${{ inputs.triplet }}
run: |
echo "::group::Configure build Python"
./Android/android.py configure-build
echo "::endgroup::"

echo "::group::Compile build Python"
./Android/android.py make-build
echo "::endgroup::"

echo "::group::Configure host Python"
./Android/android.py configure-host ${{ inputs.triplet }}
echo "::endgroup::"

echo "::group::Compile host Python"
./Android/android.py make-host ${{ inputs.triplet }}
echo "::endgroup::"

echo "::group::Make release package"
./Android/android.py package ${{ inputs.triplet }}
echo "::endgroup::"

if [ "$RUNNER_OS" = "Linux" ] && [ "$RUNNER_ARCH" = "X64"]; then
# https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/
echo "::group::Enable KVM for Android emulator"
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
echo "::endgroup::"

echo "::group::Unpack release artifact"
mkdir $RUNNER_TEMP/android
tar -C $RUNNER_TEMP/android -xf cross-build/${{ inputs.triplet }}/dist/*
echo "::endgroup::"

echo "::group::Tests"
# Arguments are similar to --fast-ci, but in single-process mode.
$RUNNER_TEMP/android/android.py test --managed maxVersion -v -- \
--single-process --fail-env-changed --rerun --slowest --verbose3 \
-u "all,-cpu" --timeout=600
echo "::endgroup::"

else
echo "Skipping test: GitHub Actions currently only supports the " \
"Android emulator on Linux x86_64."
fi

- uses: actions/upload-artifact@v4
with:
name: ${{ inputs.triplet }}
path: cross-build/${{ inputs.triplet }}/dist/*
if-no-files-found: error

# Currently, GitHub Actions can only run the Android emulator on Linux, so
# all the remaining steps are conditional on that.

# (https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/).
- name: Enable KVM for Android emulator
if: runner.os == 'Linux'
shell: bash
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

- name: Unpack release artifact
if: runner.os == 'Linux'
shell: bash
run: |
mkdir $RUNNER_TEMP/android
tar -C $RUNNER_TEMP/android -xf cross-build/${{ inputs.triplet }}/dist/*

- name: Tests
if: runner.os == 'Linux'
shell: bash
# Arguments are similar to --fast-ci, but in single-process mode.
run: |
$RUNNER_TEMP/android/android.py test --managed maxVersion -v -- \
--single-process --fail-env-changed --rerun --slowest --verbose3 \
-u "all,-cpu" --timeout=600
Loading