<commit_before>name: CI
on:
  push

concurrency:
  # Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}.
  # On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke.
  # More info: https://stackoverflow.com/a/68422069/253468:
  group: ${{ github.ref == 'refs/heads/master' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }}
  cancel-in-progress: true
jobs:
  build:
    name: 🔨 Build & Verify
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - name: Set up JDK 11.
        uses: actions/setup-java@v3
        with:
          distribution: 'zulu'
          java-version: 11

      - name: Set up Android SDK.
        uses: android-actions/setup-android@v2

      - name: Checkout ${{ github.ref }} branch in ${{ github.repository }} repository.
        uses: actions/checkout@v3

      - name: Build & Verify project using Gradle.
        id: gradle
        run: >
          ./gradlew
          --no-daemon
          --no-build-cache
          --stacktrace
          --continue
          assemble
          lint

      - name: Upload "Reports" artifact.
        if: success() || failure()
        uses: actions/upload-artifact@v3
        with:
          name: Reports
          path: |
            ${{ github.workspace }}/build/reports/

      - name: Upload "APKs" artifact.
        if: success() || failure()
        uses: actions/upload-artifact@v3
        with:
          name: APKs
          path: |
            ${{ github.workspace }}/build/outputs/apk/

  shadow-build-agp:
    name: 🔨 Build & Verify (AGP shadow)
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - name: Set up JDK 11.
        uses: actions/setup-java@v3
        with:
          distribution: 'zulu'
          java-version: 11

      - name: Set up Android SDK.
        uses: android-actions/setup-android@v2

      - name: Checkout ${{ github.ref }} branch in ${{ github.repository }} repository.
        uses: actions/checkout@v3

      - name: Patch build so latest AGP version is used.
        run: |
          # Based on https://stackoverflow.com/a/15966279/253468
          # Based on https://stackoverflow.com/a/26469351/253468
          sed --in-place --regexp-extended --file - build.gradle <<'SED_SCRIPT'
            # Search for the line that contains the AGP version.
            /id\("com.android.application"\) version "(.*)"/,${
              # If found, replace with latest version. (s//.../ will use the last match)
              s//id("com.android.application") version "8.0.0-alpha01"/;
              # GOTO end of script. (therefore skipping exit 1)
              b;
            };
            # exit 1, will only execute if no replacement was made.
            $q1;<commit_msg>Update dependency com.android.tools.build:gradle from 8.0.0-alpha01 to 8.0.0-alpha05 (#11)<commit_after>name: CI
on:
  push

concurrency:
  # Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}.
  # On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke.
  # More info: https://stackoverflow.com/a/68422069/253468:
  group: ${{ github.ref == 'refs/heads/master' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }}
  cancel-in-progress: true
jobs:
  build:
    name: 🔨 Build & Verify
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - name: Set up JDK 11.
        uses: actions/setup-java@v3
        with:
          distribution: 'zulu'
          java-version: 11

      - name: Set up Android SDK.
        uses: android-actions/setup-android@v2

      - name: Checkout ${{ github.ref }} branch in ${{ github.repository }} repository.
        uses: actions/checkout@v3

      - name: Build & Verify project using Gradle.
        id: gradle
        run: >
          ./gradlew
          --no-daemon
          --no-build-cache
          --stacktrace
          --continue
          assemble
          lint

      - name: Upload "Reports" artifact.
        if: success() || failure()
        uses: actions/upload-artifact@v3
        with:
          name: Reports
          path: |
            ${{ github.workspace }}/build/reports/

      - name: Upload "APKs" artifact.
        if: success() || failure()
        uses: actions/upload-artifact@v3
        with:
          name: APKs
          path: |
            ${{ github.workspace }}/build/outputs/apk/

  shadow-build-agp:
    name: 🔨 Build & Verify (AGP shadow)
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - name: Set up JDK 11.
        uses: actions/setup-java@v3
        with:
          distribution: 'zulu'
          java-version: 11

      - name: Set up Android SDK.
        uses: android-actions/setup-android@v2

      - name: Checkout ${{ github.ref }} branch in ${{ github.repository }} repository.
        uses: actions/checkout@v3

      - name: Patch build so latest AGP version is used.
        run: |
          # Based on https://stackoverflow.com/a/15966279/253468
          # Based on https://stackoverflow.com/a/26469351/253468
          sed --in-place --regexp-extended --file - build.gradle <<'SED_SCRIPT'
            # Search for the line that contains the AGP version.
            /id\("com.android.application"\) version "(.*)"/,${
              # If found, replace with latest version. (s//.../ will use the last match)
              s//id("com.android.application") version "8.0.0-alpha05"/;
              # GOTO end of script. (therefore skipping exit 1)
              b;
            };
            # exit 1, will only execute if no replacement was made.
            $q1;
{'fraction_non_alphanumeric': 0.12179378291149992, 'fraction_numerical': 0.026499065738066926, 'mean_word_length': 1.8905252822778595, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3914884', 'n_tokens_mistral': 1927, 'n_tokens_neox': 1721, 'n_words': 500}