Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90c72ec0 authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Cache app/build to speed up builds

parent ee637e4f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -35,6 +35,14 @@ jobs:
        java-version: 17
    - uses: gradle/gradle-build-action@v2

    - name: Use app/build and gradle configuration cache
      uses: actions/cache/restore@v3
      with:
        key: app_build-tests-without-emulator
        path: |
          .gradle/configuration-cache
          app/build

    # Initializes the CodeQL tools for scanning.
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v2
+36 −0
Original line number Diff line number Diff line
@@ -16,6 +16,15 @@ jobs:
          java-version: 17
      - uses: gradle/gradle-build-action@v2

      - name: Use app/build and gradle configuration cache
        if: ${{ github.ref != 'refs/heads/dev-ose' }}
        uses: actions/cache/restore@v3
        with:
          key: app_build-tests-without-emulator
          path: |
            .gradle/configuration-cache
            app/build

      - name: Run lint and unit tests
        run: ./gradlew app:check
      - name: Archive results
@@ -26,6 +35,15 @@ jobs:
            app/build/outputs/lint*
            app/build/reports

      - name: Cache app/build and gradle configuration
        if: ${{ github.ref == 'refs/heads/dev-ose' }}
        uses: actions/cache/save@v3
        with:
          key: app_build-tests-without-emulator
          path: |
            .gradle/configuration-cache
            app/build

  test_on_emulator:
    name: Tests with emulator
    runs-on: ubuntu-latest-4-cores
@@ -40,6 +58,15 @@ jobs:
          java-version: 17
      - uses: gradle/gradle-build-action@v2

      - name: Use app/build and gradle configuration cache
        if: ${{ github.ref != 'refs/heads/dev-ose' }}
        uses: actions/cache/restore@v3
        with:
          key: app_build-tests-with-emulator
          path: |
            .gradle/configuration-cache
            app/build

      - 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
@@ -76,6 +103,15 @@ jobs:
          disable-animations: true
          script: ./gradlew app:connectedCheck

      - name: Cache app/build and gradle configuration
        if: ${{ github.ref == 'refs/heads/dev-ose' }}
        uses: actions/cache/save@v3
        with:
          key: app_build-tests-with-emulator
          path: |
            .gradle/configuration-cache
            app/build

      - name: Archive results
        if: always()
        uses: actions/upload-artifact@v2
+6 −4
Original line number Diff line number Diff line
# [https://developer.android.com/build/optimize-your-build#optimize]
# https://developer.android.com/build/optimize-your-build
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx4g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=512m
org.gradle.parallel=true

# configuration cache [https://developer.android.com/build/optimize-your-build#use-the-configuration-cache-experimental]
org.gradle.unsafe.configuration-cache=true
org.gradle.unsafe.configuration-cache-problems=warn
org.gradle.configuration-cache=true
org.gradle.configuration-cache.problems=warn

# https://docs.gradle.org/current/userguide/build_cache.html
org.gradle.caching=true

# Android
android.useAndroidX=true