Skip to content

#9: combine ci & emulated tests #78

#9: combine ci & emulated tests

#9: combine ci & emulated tests #78

Workflow file for this run

name: Android CI
on:
pull_request:
types:
- opened
- synchronize
- reopened
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: display action
run: echo trigger event=${{ github.event_name }}
- name: checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew clean build
androidEmulatedTest:
if: github.event_name != 'pull_request' # perform emulated tests only on PRs
runs-on: ubuntu-latest # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md
env:
JAVA_TOOL_OPTIONS: -Xmx4g
steps:
- name: run supportedSdksGroupDebugAndroidTest
run: ./gradlew supportedSdksGroupDebugAndroidTest -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" -Pandroid.experimental.testOptions.managedDevices.emulators.emulator.showKernelLogging=true --info
sonar:
runs-on: ubuntu-latest
steps:
- name: Sonar checks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew jacocoTestReport sonar
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: Reports
path: ${{ github.workspace }}/app/build/reports/
retention-days: 14