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

Unverified Commit b4ba4938 authored by Rafael Tonholo's avatar Rafael Tonholo Committed by GitHub
Browse files

Merge pull request #9681 from rafaeltonholo/ci/update-pr-pipeline

ci: introduce new PR workflow
parents 789c1bc4 b75cc56c
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
name: Gradle cache
description: Enable Gradle Wrapper caching (optimization)
runs:
  using: 'composite'
  steps:
    - name: Enable Gradle Wrapper caching
      uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # 4.2.4
      with:
        path:
          ~/.gradle/caches
          ~/.gradle/wrapper
        key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
        restore-keys: |
          ${{ runner.os }}-gradle-
+20 −0
Original line number Diff line number Diff line
name: Set up build environment
description: Prepares environment for building with JDK and Gradle
runs:
  using: 'composite'
  steps:
    - name: Copy CI gradle.properties
      shell: bash
      run: mkdir -p ~/.gradle ; cp .github/ci-gradle-android-pr-workflow.properties ~/.gradle/gradle.properties

    - name: Set up JDK
      uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
      with:
        distribution: 'temurin'
        java-version: '17'

    - name: Set up Gradle
      uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1

    - name: Restore Gradle cache
      uses: ./.github/actions/gradle_cache
+10 −0
Original line number Diff line number Diff line
org.gradle.daemon=false
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configuration-cache=true
org.gradle.configuration-cache.parallel=true
org.gradle.workers.max=4
org.gradle.jvmargs=-Xmx10g -XX:MaxMetaspaceSize=4g -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:+HeapDumpOnOutOfMemoryError

kotlin.incremental=true
kotlin.compiler.execution.strategy=in-process
+190 −0
Original line number Diff line number Diff line
name: Pull request checks
on:
  pull_request:
    paths-ignore:
      - '.idea/**'
      - '.gitattributes'
      - '.github/**.json'
      - '.gitignore'
      - '.gitmodules'
      - '**.md'
      - 'LICENSE'
      - 'NOTICE'

env:
  CI_CHECK_RELEASE_BUILDS: 'false'

permissions:
  contents: read

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.pull_request.number || 'no-pr' }}
  cancel-in-progress: true

jobs:
  build-k9:
    name: Build K9 application
    runs-on: ubuntu-latest
    timeout-minutes: 90
    steps:
      - name: Checkout the repo
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - name: Prepares environment
        uses: ./.github/actions/setup

      - name: Build K9 application
        run: ./gradlew :app-k9mail:assemble

  build-thunderbird:
    name: Build Thunderbird application
    runs-on: ubuntu-latest
    timeout-minutes: 90
    steps:
      - name: Checkout the repo
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - name: Prepares environment
        uses: ./.github/actions/setup

      - name: Build Thunderbird application
        run: ./gradlew :app-thunderbird:assemble

  build-app-ui-catalog:
    name: Build App UI-catalog application
    runs-on: ubuntu-latest
    timeout-minutes: 90
    steps:
      - name: Checkout the repo
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - name: Prepares environment
        uses: ./.github/actions/setup

      - name: Build App UI-catalog application in Debug mode
        run: ./gradlew :app-ui-catalog:assembleDebug

  build-cli-tools:
    name: Build CLI tools if needed
    runs-on: ubuntu-latest
    timeout-minutes: 90
    steps:
      - name: Check if CLI tools are changed
        uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
        id: changes
        with:
          filters: |
            cli_tools_changed:
              - 'cli/**'
      - name: Build CLI tools
        # run only if CLI tools were changed
        if: steps.changes.outputs.cli_tools_changed == 'true'
        run: ./gradlew buildCliTools

  lint:
    name: Quality - Lint
    runs-on: ubuntu-latest
    timeout-minutes: 90
    steps:
      - name: Checkout the repo
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - name: Prepares environment
        uses: ./.github/actions/setup

      - name: Running Android lint
        run: ./gradlew lint

  spotless:
    name: Quality - Spotless
    runs-on: ubuntu-latest
    timeout-minutes: 90
    steps:
      - name: Checkout the repo
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - name: Prepares environment
        uses: ./.github/actions/setup

      - name: Running spotless check
        run: ./gradlew spotlessCheck

  detekt:
    name: Quality - Detekt
    runs-on: ubuntu-latest
    timeout-minutes: 90
    steps:
      - name: Checkout the repo
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - name: Prepares environment
        uses: ./.github/actions/setup

      - name: Running Detekt
        run: ./gradlew detekt

      - name: Running Detekt including KMP
        # As we were not verifying detekt in KMP sources before,
        # this step is likely to fail.
        continue-on-error: true
        run: |
          ./gradlew detektMetadataCommonMain
          ./gradlew detektMetadataMain
          ./gradlew detektMetadataCommonJvmMain

  unit-test:
    name: Quality - Unit tests
    runs-on: ubuntu-latest
    timeout-minutes: 90
    steps:
      - name: Checkout the repo
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - name: Prepares environment
        uses: ./.github/actions/setup

      - name: Running unit tests
        run: ./gradlew testDebugUnitTest --parallel

  dependency-guard:
    name: Quality - Dependency Guard
    runs-on: ubuntu-latest
    timeout-minutes: 90
    steps:
      - name: Checkout the repo
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - name: Prepares environment
        uses: ./.github/actions/setup

      - name: Running Dependency Guard
        run: ./gradlew dependencyGuard

  check-badging:
    name: Quality - Badging
    runs-on: ubuntu-latest
    timeout-minutes: 90
    steps:
      - name: Checkout the repo
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - name: Prepares environment
        uses: ./.github/actions/setup

      - name: Running K9 Badging
        run: |
          ./gradlew :app-k9mail:checkFossReleaseBadging \
                    :app-k9mail:checkFullReleaseBadging \
                    -x assemble \
                    -x build

      - name: Running Thunderbird Badging
        run: |
          ./gradlew :app-thunderbird:checkFossBetaBadging \
                    :app-thunderbird:checkFossDailyBadging \
                    :app-thunderbird:checkFossReleaseBadging \
                    :app-thunderbird:checkFullBetaBadging \
                    :app-thunderbird:checkFullDailyBadging \
                    :app-thunderbird:checkFullReleaseBadging \
                    -x assemble \
                    -x build
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ internal fun CommonExtension<*, *, *, *, *, *>.configureSharedConfig(project: Pr
        checkDependencies = true
        lintConfig = project.file("${project.rootProject.projectDir}/config/lint/lint.xml")
        baseline = project.file("${project.rootProject.projectDir}/config/lint/android-lint-baseline.xml")
        checkReleaseBuilds = System.getenv("CI_CHECK_RELEASE_BUILDS")?.toBoolean() ?: true
    }

    testOptions {
Loading