Skip to content

Update cert4android #785

Update cert4android

Update cert4android #785

Workflow file for this run

name: core tests
on:
push:
branches:
- main
- release
pull_request:
concurrency:
group: ${{github.workflow_ref}}-${{ github.ref }}
cancel-in-progress: true
# We provide a remote Gradle build cache. Take the settings from the secrets and enable
# configuration and build cache for all gradle jobs.
#
# Note: The secrets are not available for forks and Dependabot PRs.
env:
GRADLE_BUILDCACHE_URL: ${{ secrets.gradle_buildcache_url }}
GRADLE_BUILDCACHE_USERNAME: ${{ secrets.gradle_buildcache_username }}
GRADLE_BUILDCACHE_PASSWORD: ${{ secrets.gradle_buildcache_password }}
GRADLE_OPTS: -Dorg.gradle.caching=true -Dorg.gradle.configuration-cache=true
JAVA_VERSION: 21 # keep in sync with gradle/gradle-daemon-jvm.properties
jobs:
compile:
name: Compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}
# See https://community.gradle.org/github-actions/docs/setup-gradle/ for more information
- uses: gradle/actions/setup-gradle@v6
with:
cache-encryption-key: ${{ secrets.gradle_encryption_key }}
cache-read-only: false # allow to update the cache
gradle-home-cache-excludes: caches/build-cache-1 # don't cache local build cache because we use a remote cache
- name: Compile
run: ./gradlew app-ose:assembleDebug
unit_tests:
needs: compile
name: Lint and unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}
- uses: gradle/actions/setup-gradle@v6
with:
cache-encryption-key: ${{ secrets.gradle_encryption_key }}
cache-read-only: true
- name: Lint checks
run: ./gradlew core:lintDebug app:lintOseDebug
- name: Unit tests
# currently no unit tests for app-ose
run: ./gradlew core:testDebugUnitTest
instrumented_tests:
needs: compile
name: Instrumented tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}
- uses: gradle/actions/setup-gradle@v6
with:
cache-encryption-key: ${{ secrets.gradle_encryption_key }}
cache-read-only: true
# Gradle and Android SDK often take more space than what is available on the default runner.
# We try to free a few GB here to make gradle-managed devices more reliable.
- name: Free some disk space
uses: jlumbroso/free-disk-space@main
with:
android: false # we need the Android SDK
large-packages: false # apt takes too long
swap-storage: false # Gradle needs much memory
# Enable virtualization for Android emulator
- 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
- name: Instrumented tests
# currently no instrumented tests for app-ose
run: ./gradlew core:virtualDebugAndroidTest