Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable KVM for instrumentation #26

Merged
merged 5 commits into from
Jan 26, 2024
Merged
Changes from all commits
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
36 changes: 21 additions & 15 deletions .github/workflows/instrumentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jobs:

android:
name: "API ${{ inputs.android-api }}"
runs-on: macos-latest
runs-on: ubuntu-latest

permissions:
# actions/checkout
Expand All @@ -175,6 +175,12 @@ jobs:
with:
submodules: recursive

- name: "Enable KVM."
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: "Calculate emulator properties"
id: emulator
env:
Expand Down Expand Up @@ -207,7 +213,7 @@ jobs:
PACKAGE="system-images;android-${{ steps.emulator.outputs.api-level }};${{ steps.emulator.outputs.target }};${{ steps.emulator.outputs.arch }}"
DEVICE="${{ steps.emulator.outputs.profile }}-${{ steps.emulator.outputs.sdcard }}"
echo -e "cache-paths<<EOF\n${CACHE_PATHS}\nEOF" >> $GITHUB_OUTPUT
echo "cache-key=android-emulator-${DEVICE}-${PACKAGE}-${{ hashFiles('setup-script.sh') }}-v0" >> $GITHUB_OUTPUT
echo "cache-key=android-emulator-${DEVICE}-${PACKAGE}-${{ hashFiles('setup-script.sh') }}-v1" >> $GITHUB_OUTPUT

- name: "Load AVD cache"
if: inputs.cache
Expand Down Expand Up @@ -326,28 +332,28 @@ jobs:
if-no-files-found: error
path: |
# AGP UTP additional output
${{ github.workspace }}/**/build/outputs/connected_android_test_additional_output/
**/build/outputs/connected_android_test_additional_output/

# AGP 7.x and 8.x results in all formats.
${{ github.workspace }}/**/build/outputs/androidTest-results/connected/
**/build/outputs/androidTest-results/connected/

# AGP 7.4 and 8.0 HTML
${{ github.workspace }}/**/build/reports/androidTests/connected/
**/build/reports/androidTests/connected/

# AGP 7.4 and 8.0 XML
${{ github.workspace }}/**/build/outputs/androidTest-results/connected/TEST-*.xml
**/build/outputs/androidTest-results/connected/TEST-*.xml

# AGP 7.4 and 8.0 binary results
${{ github.workspace }}/**/build/outputs/androidTest-results/connected/test-result.pb
**/build/outputs/androidTest-results/connected/test-result.pb

# AGP 7.4 and 8.0 details
${{ github.workspace }}/**/build/outputs/androidTest-results/connected/*/
**/build/outputs/androidTest-results/connected/*/

# AGP 4.1 XML, *AndroidTest is variant component name, e.g. debugAndroidTest
${{ github.workspace }}/**/build/outputs/androidTest-results/connected/flavors/*AndroidTest/
**/build/outputs/androidTest-results/connected/flavors/*AndroidTest/

# AGP 4.1 HTML, *AndroidTest is variant component name, e.g. debugAndroidTest
${{ github.workspace }}/**/build/reports/androidTests/connected/flavors/*AndroidTest/
**/build/reports/androidTests/connected/flavors/*AndroidTest/

# Exclude names with colon: https://issuetracker.google.com/issues/223643506
!**/*:*
Expand All @@ -359,14 +365,14 @@ jobs:
name: '${{ format(inputs.name-artifact-merged, steps.emulator.outputs.api-level, steps.emulator.outputs.target, steps.emulator.outputs.arch) }}'
if-no-files-found: error
path: |
${{ github.workspace }}/build/androidTest-results/
build/androidTest-results/

# Exclude names with colon: https://issuetracker.google.com/issues/223643506
!**/*:*

- name: "Publish '${{ format(inputs.name-check-results, steps.emulator.outputs.api-level, steps.emulator.outputs.target, steps.emulator.outputs.arch) }}' check suite."
if: success() || failure()
uses: EnricoMi/publish-unit-test-result-action/composite@v2
uses: EnricoMi/publish-unit-test-result-action@v2
with:
check_name: '${{ format(inputs.name-check-results, steps.emulator.outputs.api-level, steps.emulator.outputs.target, steps.emulator.outputs.arch) }}'
# Do not comment on PRs, only create a check on the commit.
Expand All @@ -380,11 +386,11 @@ jobs:
# AGP 8.1
# /*/ is variant name, e.g. /debug/
# TEST-*.xml contains the emulator name and version and module, e.g. TEST-test(AVD) - 5.0.2-_about-.xml
${{ github.workspace }}/**/build/outputs/androidTest-results/connected/*/TEST-*.xml
**/build/outputs/androidTest-results/connected/*/TEST-*.xml

# AGP 7.4 and 8.0
${{ github.workspace }}/**/build/outputs/androidTest-results/connected/TEST-*.xml
**/build/outputs/androidTest-results/connected/TEST-*.xml

# AGP 4.1
# *AndroidTest is variant component name, e.g. debugAndroidTest
${{ github.workspace }}/**/build/outputs/androidTest-results/connected/flavors/*AndroidTest/TEST-*.xml
**/build/outputs/androidTest-results/connected/flavors/*AndroidTest/TEST-*.xml