@@ -15,42 +15,58 @@ runs:
1515 using : composite
1616
1717 steps :
18- # Build Python, and package it into a release artifact.
18+ # The steps of a composite action are not clearly divided in the GitHub
19+ # UI, so use a single step with ::group:: markers instead.
1920 - shell : bash
20- run : ./Android/android.py build ${{ inputs.triplet }}
21- - shell : bash
22- run : ./Android/android.py package ${{ inputs.triplet }}
21+ run : |
22+ echo "::group::Configure build Python"
23+ ./Android/android.py configure-build
24+ echo "::endgroup::"
25+
26+ echo "::group::Compile build Python"
27+ ./Android/android.py make-build
28+ echo "::endgroup::"
29+
30+ echo "::group::Configure host Python"
31+ ./Android/android.py configure-host ${{ inputs.triplet }}
32+ echo "::endgroup::"
33+
34+ echo "::group::Compile host Python"
35+ ./Android/android.py make-host ${{ inputs.triplet }}
36+ echo "::endgroup::"
37+
38+ echo "::group::Make release package"
39+ ./Android/android.py package ${{ inputs.triplet }}
40+ echo "::endgroup::"
41+
42+ if [ "$RUNNER_OS" = "Linux" ] && [ "$RUNNER_ARCH" = "X64"]; then
43+ # https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/
44+ echo "::group::Enable KVM for Android emulator"
45+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
46+ | sudo tee /etc/udev/rules.d/99-kvm4all.rules
47+ sudo udevadm control --reload-rules
48+ sudo udevadm trigger --name-match=kvm
49+ echo "::endgroup::"
50+
51+ echo "::group::Unpack release artifact"
52+ mkdir $RUNNER_TEMP/android
53+ tar -C $RUNNER_TEMP/android -xf cross-build/${{ inputs.triplet }}/dist/*
54+ echo "::endgroup::"
55+
56+ echo "::group::Tests"
57+ # Arguments are similar to --fast-ci, but in single-process mode.
58+ $RUNNER_TEMP/android/android.py test --managed maxVersion -v -- \
59+ --single-process --fail-env-changed --rerun --slowest --verbose3 \
60+ -u "all,-cpu" --timeout=600
61+ echo "::endgroup::"
62+
63+ else
64+ echo "Skipping test: GitHub Actions currently only supports the " \
65+ "Android emulator on Linux x86_64."
66+ fi
67+
2368 - uses : actions/upload-artifact@v4
2469 with :
2570 name : ${{ inputs.triplet }}
2671 path : cross-build/${{ inputs.triplet }}/dist/*
2772 if-no-files-found : error
28-
29- # Currently, GitHub Actions can only run the Android emulator on Linux, so
30- # all the remaining steps are conditional on that.
31-
32- # (https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/).
33- - name : Enable KVM for Android emulator
34- if : runner.os == 'Linux'
35- shell : bash
36- run : |
37- echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
38- | sudo tee /etc/udev/rules.d/99-kvm4all.rules
39- sudo udevadm control --reload-rules
40- sudo udevadm trigger --name-match=kvm
41-
42- - name : Unpack release artifact
43- if : runner.os == 'Linux'
44- shell : bash
45- run : |
46- mkdir $RUNNER_TEMP/android
47- tar -C $RUNNER_TEMP/android -xf cross-build/${{ inputs.triplet }}/dist/*
48-
49- - name : Tests
50- if : runner.os == 'Linux'
51- shell : bash
52- # Arguments are similar to --fast-ci, but in single-process mode.
53- run : |
54- $RUNNER_TEMP/android/android.py test --managed maxVersion -v -- \
55- --single-process --fail-env-changed --rerun --slowest --verbose3 \
56- -u "all,-cpu" --timeout=600
0 commit comments