Feature modules #219
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android CI | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- 'android/**' | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "checkout" | |
uses: actions/[email protected] | |
- name: Kotlin Linter | |
uses: vroy/gha-kotlin-linter@v4 | |
build: | |
runs-on: ubuntu-latest | |
needs: lint | |
steps: | |
- name: Delete unnecessary tools 🔧 | |
uses: jlumbroso/[email protected] | |
with: | |
android: false # Don't remove Android tools | |
tool-cache: true # Remove image tool cache - rm -rf "$AGENT_TOOLSDIRECTORY" | |
dotnet: true # rm -rf /usr/share/dotnet | |
haskell: true # rm -rf /opt/ghc... | |
swap-storage: true # rm -f /mnt/swapfile (4GiB) | |
docker-images: false # Takes 16s, enable if needed in the future | |
large-packages: false # includes google-cloud-sdk and it's slow | |
- name: Enable KVM group perms | |
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 | |
ls /dev/kvm | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: set up JDK 17 | |
uses: actions/[email protected] | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Set up Android SDK | |
uses: android-actions/[email protected] | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew assembleDebug | |
- name: Unit tests | |
run: ./gradlew testDebugUnitTest | |
- name: Run instrumented test | |
uses: ReactiveCircus/[email protected] | |
with: | |
arch: 'x86_64' | |
api-level: 33 | |
script: ./gradlew connectedDebugAndroidTest | |
- name: Generate kover coverage report | |
run: ./gradlew koverXmlReportDebug | |
- name: Add coverage report to PR | |
id: kover | |
uses: mi-kas/[email protected] | |
with: | |
path: | | |
app/build/reports/kover/reportDebug.xml | |
core/data/build/reports/kover/reportDebug.xml | |
core/database/build/reports/kover/reportDebug.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
title: Code Coverage | |
update-comment: true | |
- name: Upload Test Reports Folder | |
uses: actions/[email protected] | |
if: ${{ always() }} | |
with: | |
name: reports | |
path: | | |
app/build/reports | |
app/build/test-results | |
core/data/build/reports | |
core/data/build/test-results | |
core/database/build/reports | |
core/database/build/test-results | |
report: | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{ always() }} | |
steps: | |
- name: Download Test Reports Folder | |
uses: actions/[email protected] | |
with: | |
name: reports | |
- name: Android Test Report | |
uses: asadmansr/[email protected] |