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

Unverified Commit 3462ee65 authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé Committed by GitHub
Browse files

Merge pull request #9924 from wmontwe/chore-ci-android-workflow-improvments

chore(ci): Android workflow improvments
parents 3f3d5d7b 63301c98
Loading
Loading
Loading
Loading

.github/workflows/android-pr.yml

deleted100644 → 0
+0 −199
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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

      - 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

      - 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

      - 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: Checkout the repo
        if: steps.changes.outputs.cli_tools_changed == 'true'
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

      - name: Setup Gradle environment
        if: steps.changes.outputs.cli_tools_changed == 'true'
        uses: ./.github/actions/setup-gradle

      - 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

      - 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

      - 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

      - 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

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

  dependency-guard:
    name: Quality - Dependency Guard
    runs-on: ubuntu-latest
    timeout-minutes: 90
    steps:
      - name: Checkout the repo
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

      - 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

      - 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
+102 −16
Original line number Diff line number Diff line
@@ -23,8 +23,8 @@ concurrency:
  cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
  build-android:
    name: Build Android application
  build-common:
    name: Build common code
    runs-on: ubuntu-latest
    timeout-minutes: 90

@@ -45,28 +45,114 @@ jobs:
        with:
          write-cache: ${{ github.ref == 'refs/heads/main' }}

      - name: Prime configuration and dependency cache
        run: ./gradlew --no-daemon help

      - name: Assemble common
        run: ./gradlew :app-common:assemble

      - name: Show disk usage
        uses: ./.github/actions/disk-usage

      - name: Quality - Spotless
        run: ./gradlew spotlessCheck
  build-k9:
    name: Build K9 application
    runs-on: ubuntu-latest
    timeout-minutes: 90
    needs: [build-common]
    steps:
      - name: Checkout the repo
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          fetch-depth: 1

      - name: Quality - Detekt
        run: ./gradlew detekt
      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

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

      - name: Show disk usage
        uses: ./.github/actions/disk-usage
      - name: Check K9 Badging
        run: |
          ./gradlew :app-k9mail:checkFossReleaseBadging \
                    :app-k9mail:checkFullReleaseBadging \
                    -x assemble \
                    -x build

      - name: Quality - Dependency Guard
        run: ./gradlew dependencyGuard
  build-thunderbird:
    name: Build Thunderbird application
    runs-on: ubuntu-latest
    timeout-minutes: 90
    needs: [build-common]
    steps:
      - name: Checkout the repo
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          fetch-depth: 1

      - name: Build (run full build and tests)
        run: ./gradlew build
      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

      - name: Show disk usage
        uses: ./.github/actions/disk-usage
      - name: Build Thunderbird application
        run: ./gradlew :app-thunderbird:assemble

      - name: Check 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

  build-ui-catalog:
    name: Build UI-catalog application
    runs-on: ubuntu-latest
    timeout-minutes: 90
    needs: [build-common]
    steps:
      - name: Checkout the repo
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          fetch-depth: 1

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

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

  quality-unit-test:
    name: Quality - Unit tests
    runs-on: ubuntu-latest
    timeout-minutes: 90
    needs: [build-common]
    steps:
      - name: Checkout the repo
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          fetch-depth: 1

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

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

  quality-lint:
    name: Quality - Lint
    runs-on: ubuntu-latest
    timeout-minutes: 90
    needs: [build-common]
    steps:
      - name: Checkout the repo
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          fetch-depth: 1

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

      - name: Running Android lint
        run: ./gradlew lint
+35 −0
Original line number Diff line number Diff line
name: CLI Tools CI

on:
  push:
    branches:
      - main
    paths:
      - 'cli/**'
  pull_request:
    paths:
      - 'cli/**'

permissions:
  contents: read

concurrency:
  group: cli-tools-ci-${{ github.ref }}-${{ github.event.pull_request.number || 'no-pr' }}
  cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
  build-cli-tools:
    name: Build CLI tools
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - name: Checkout the repo
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          fetch-depth: 1

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

      - name: Build CLI tools
        run: ./gradlew buildCliTools
+98 −0
Original line number Diff line number Diff line
name: Quality checks

on:
  push:
    branches:
      - main
  pull_request:
    paths-ignore:
      - '.idea/**'
      - '.gitattributes'
      - '.github/**.json'
      - '.gitignore'
      - '.gitmodules'
      - '**.md'
      - 'LICENSE'
      - 'NOTICE'

concurrency:
  group: quality-checks-${{ github.ref }}-${{ github.event.pull_request.number || 'no-pr' }}
  cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
  quality-spotless:
    name: Spotless check
    runs-on: ubuntu-latest
    timeout-minutes: 30

    steps:
      - name: Checkout the repo
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          fetch-depth: 1

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

      - name: Quality - Spotless
        run: ./gradlew spotlessCheck

  quality-detekt:
    name: Detekt check
    runs-on: ubuntu-latest
    timeout-minutes: 30

    steps:
      - name: Checkout the repo
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          fetch-depth: 1

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

      - name: Quality - 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

  quality-dependency-guard:
    name: Dependency guard check
    runs-on: ubuntu-latest
    timeout-minutes: 30

    steps:
      - name: Checkout the repo
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          fetch-depth: 1

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

      - name: Quality - Dependency guard
        run: ./gradlew dependencyGuard

  quality-konsist:
    name: Konsist check
    runs-on: ubuntu-latest
    timeout-minutes: 30

    steps:
      - name: Checkout the repo
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          fetch-depth: 1

      - name: Setup Gradle environment
        uses: ./.github/actions/setup-gradle

      - name: Quality - Konsist
        run: ./gradlew :quality:konsist:test
+4 −3
Original line number Diff line number Diff line
@@ -37,9 +37,10 @@ tasks.register("testsOnCi") {
    val skipTests = setOf("testReleaseUnitTest")

    dependsOn(
        subprojects.map { project -> project.tasks.withType(Test::class.java) }
            .flatten()
            .filterNot { task -> task.name in skipTests },
        subprojects
            .filterNot { it.path == ":quality:konsist" } // Konsist tests should be run separately
            .flatMap { it.tasks.withType(Test::class.java) }
            .filterNot { it.name in skipTests },
    )
}

Loading