<commit_before>name: build

on: [push, pull_request]

jobs:
  test:
    runs-on: macos-latest

    strategy:
      fail-fast: false
      matrix:
        api-level:
          # Test against the API 17, as the API 16 raises an error:
          # `com.android.ddmlib.InstallException: Unknown failure: Error: Unknown option: -d`
          # `usage: pm list packages [-f] [-d] [-e] [-s] [-3] [-i] [-u] [FILTER]`
          - 17 
          - 24
          - 29

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Validate Gradle Wrapper
        uses: gradle/wrapper-validation-action@v1

      - name: Run Tests
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: ${{ matrix.api-level }}
          script: |
            adb logcat -c
            adb logcat > logcat.log &
            ./gradlew createDebugCoverageReport coveralls
        env:
          API_LEVEL: ${{ matrix.api-level }}

      - name: Load logs if failed
        if: ${{ failure() }}
        uses: actions/upload-artifact@v2
        with: 
          name: logcat-${{ matrix.api-level }}
          path: logcat.log

  deploy:
    needs: test
    if: startsWith(github.ref, 'refs/tags/')
    
    runs-on: macos-latest

    env:
      BINTRAY_SNOWPLOW_MAVEN_USER: ${{ secrets.BINTRAY_SNOWPLOW_MAVEN_USER }}
      BINTRAY_SNOWPLOW_MAVEN_API_KEY: ${{ secrets.BINTRAY_SNOWPLOW_MAVEN_API_KEY }}
            
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Validate Gradle Wrapper
        uses: gradle/wrapper-validation-action@v1

      - name: Build
        run: ./gradlew assembleRelease

      - name: Get version (git tag)
        id: get_version
        run: |
          echo ${GITHUB_REF/refs\/tags\//}
          echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}<commit_msg>Add code coverage setting on build script (close #385)<commit_after>name: build

on: [push, pull_request]

jobs:
  test:
    runs-on: macos-latest

    strategy:
      fail-fast: false
      matrix:
        api-level:
          # Test against the API 17, as the API 16 raises an error:
          # `com.android.ddmlib.InstallException: Unknown failure: Error: Unknown option: -d`
          # `usage: pm list packages [-f] [-d] [-e] [-s] [-3] [-i] [-u] [FILTER]`
          - 17 
          - 24
          - 29

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Validate Gradle Wrapper
        uses: gradle/wrapper-validation-action@v1

      - name: Run Tests
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: ${{ matrix.api-level }}
          script: |
            adb logcat -c
            adb logcat > logcat.log &
            ./gradlew createDebugCoverageReport
        env:
          API_LEVEL: ${{ matrix.api-level }}

      - name: Load logs if failed
        if: ${{ failure() }}
        uses: actions/upload-artifact@v2
        with: 
          name: logcat-${{ matrix.api-level }}
          path: logcat.log

      - name: Load code coverage report
        if: success() && matrix.api-level == '24'
        env: 
          COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
        run: ./gradlew coveralls

  deploy:
    needs: test
    if: startsWith(github.ref, 'refs/tags/')
    
    runs-on: macos-latest

    env:
      BINTRAY_SNOWPLOW_MAVEN_USER: ${{ secrets.BINTRAY_SNOWPLOW_MAVEN_USER }}
      BINTRAY_SNOWPLOW_MAVEN_API_KEY: ${{ secrets.BINTRAY_SNOWPLOW_MAVEN_API_KEY }}
            
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Validate Gradle Wrapper
        uses: gradle/wrapper-validation-action@v1

      - name: Build
        run: ./gradlew assembleRelease

      - name: Get version (git tag)
        id: get_version
        run: |
          echo ${GITHUB_REF/refs\/tags\//}
          echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
{'fraction_non_alphanumeric': 0.11545293072824156, 'fraction_numerical': 0.009895965490992134, 'mean_word_length': 1.8359712230215828, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '4981399', 'n_tokens_mistral': 1346, 'n_tokens_neox': 1256, 'n_words': 295}