Skip to content

Run Instrumented Tests #11

Run Instrumented Tests

Run Instrumented Tests #11

# This is a basic workflow to help you get started with Actions
name: Run Instrumented Tests
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- 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: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: cd bwell-kotlin-android && chmod +x ./gradlew
- name: Gradle cache
uses: gradle/gradle-build-action@v2
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
arch: x86_64
script: cd bwell-kotlin-android && ./gradlew connectedCheck
- name: Upload Test Reports Folder
uses: actions/upload-artifact@v4
if: ${{ always() }} # IMPORTANT: Upload reports regardless of status
with:
name: reports
path: bwell-kotlin-android/app/build/outputs/**/*.xml # path to where the xml test results are stored
report:
runs-on: ubuntu-latest
needs: test # The report job will run after test job
if: ${{ always() }} # IMPORTANT: Execute report job regardless of status
steps:
- name: Download Test Reports Folder
uses: actions/download-artifact@v4
with:
name: reports
- name: Android Test Report
uses: asadmansr/[email protected]