diff --git a/.github/workflows/android-ci.yml b/.github/workflows/android-ci.yml index 6ce35af..ce0507f 100644 --- a/.github/workflows/android-ci.yml +++ b/.github/workflows/android-ci.yml @@ -6,29 +6,17 @@ on: pull_request: branches: [ "develop" ] -jobs: - lint: - name: Run ktlint - runs-on: ubuntu-latest - steps: - - name: Check out repository - uses: actions/checkout@v4 +permissions: + contents: read + checks: write + pull-requests: write - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - cache: gradle +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - - name: Run ktlint - run: ./gradlew ktlintCheck - - test: - name: Run Unit Tests +jobs: + check: + name: Run Lint and Unit Tests runs-on: ubuntu-latest steps: - name: Check out repository @@ -39,13 +27,15 @@ jobs: with: java-version: '17' distribution: 'temurin' - cache: gradle + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 - name: Grant execute permission for gradlew run: chmod +x gradlew - - name: Run unit tests - run: ./gradlew testDebugUnitTest + - name: Run Lint and Tests + run: ./gradlew ktlintCheck testDebugUnitTest --parallel --build-cache - name: Upload test results if: failure() @@ -54,9 +44,15 @@ jobs: name: test-results path: '**/build/test-results/**/*.xml' + - name: Publish Test Report + uses: mikepenz/action-junit-report@v4 + if: always() + with: + report_paths: '**/build/test-results/**/*.xml' + build: name: Build Debug APK - needs: [ lint, test ] + needs: [ check ] runs-on: ubuntu-latest steps: - name: Check out repository @@ -67,13 +63,15 @@ jobs: with: java-version: '17' distribution: 'temurin' - cache: gradle + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build Debug APK - run: ./gradlew assembleDebug + run: ./gradlew assembleDebug --parallel --build-cache - name: Upload Debug APK uses: actions/upload-artifact@v4 diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index fc50fb1..558cd1c 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -18,7 +18,9 @@ jobs: with: java-version: '17' distribution: 'temurin' - cache: gradle + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 - name: Grant execute permission for gradlew run: chmod +x gradlew @@ -36,7 +38,7 @@ jobs: RELEASE_STORE_PASSWORD_BASE64: ${{ secrets.RELEASE_STORE_PASSWORD_BASE64 }} RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }} RELEASE_KEY_PASSWORD_BASE64: ${{ secrets.RELEASE_KEY_PASSWORD_BASE64 }} - run: ./gradlew bundleRelease + run: ./gradlew bundleRelease --parallel --build-cache - name: Upload Release AAB uses: actions/upload-artifact@v4 diff --git a/gradle.properties b/gradle.properties index 541a6e1..3ff9109 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,28 +1,10 @@ -# Project-wide Gradle settings. -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. For more details, visit -# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects -# org.gradle.parallel=true -# AndroidX package structure to make it clearer which packages are bundled with the -# Android operating system, and which are packaged with your app's APK -# https://developer.android.com/topic/libraries/support-library/androidx-rn -android.useAndroidX=true -# Kotlin code style for this project: "official" or "obsolete": -kotlin.code.style=official -# Enables namespacing of each library's R class so that its R class includes only the -# resources declared in the library itself and none from the library's dependencies, -# thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true - -# Build performance optimization -org.gradle.caching=true +org.gradle.jvmargs=-Xmx4g -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g org.gradle.parallel=true +org.gradle.vfs.watch=true +org.gradle.caching=true org.gradle.configureondemand=true +kotlin.code.style=official +kotlin.incremental=true +android.useAndroidX=true +android.nonTransitiveRClass=true +ksp.incremental=true