<commit_before># Copyright © 2021 <NAME>, Inc.
#  Licensed under the Apache License, Version 2.0 (the "License"); you may not
#  use this file except in compliance with the License. You may obtain a copy of
#  the License at
#  http://www.apache.org/licenses/LICENSE-2.0
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#  License for the specific language governing permissions and limitations under
#  the License.

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
# Note: Any changes to this workflow would be used only after merging into develop
name: Build e2e tests

on:
  push:
    branches: [ develop ]
  pull_request:
    branches: [ develop]
    types: [opened, synchronize, reopened, labeled]
  workflow_dispatch:

jobs:
  build:
    runs-on: k8s-runner-e2e

    steps:
      # Pinned 1.0.0 version
      - uses: actions/checkout@v2.3.4
        with:
          path: plugin
      - name: Checkout e2e test repo
        uses: actions/checkout@v2.3.4
        with:
          repository: cdapio/cdap-e2e-tests
          path: e2e
      - name: Cache
        uses: actions/cache@v2.1.3
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ github.workflow }}-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            ${{ runner.os }}-maven-${{ github.workflow }}
      - name: Run tests
        run: python3 e2e/src/main/scripts/run_e2e_test.py
      - name: Upload report 
        uses: actions/upload-artifact@v2.2.4
        if: always()
        with:
          name: Cucumber report
          path: ./plugin/target/cucumber-reports
      - name: Upload debug files 
        uses: actions/upload-artifact@v2.2.4
        if: always()
        with:
          name: Debug files
          path: ./**/target/e2e-debug
      - name: Deploy report
        uses: peaceiris/actions-gh-pages@v3
        if: always()
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./plugin/target/cucumber-reports
          destination_dir: cucumber-reports/branches/develop
          
      - name: github-status-action
        uses: Sibz/github-status-action@67af1f4042a5a790681aad83c44008ca6cfab83d
        if: always()
        with:
          authToken: ${{ secrets.GITHUB_TOKEN }}
          state: success
          context: Cucumber report
          target_url: https://data-integrations.github.io/google-cloud/cucumber-reports/branches/develop/advanced-reports/cucumber-html-reports/overview-features.html
          <commit_msg>Ensure report is published undef proper ref (branch / PR) & add build label check<commit_after># Copyright © 2021 Cask Data, Inc.
#  Licensed under the Apache License, Version 2.0 (the "License"); you may not
#  use this file except in compliance with the License. You may obtain a copy of
#  the License at
#  http://www.apache.org/licenses/LICENSE-2.0
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#  License for the specific language governing permissions and limitations under
#  the License.

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
# Note: Any changes to this workflow would be used only after merging into develop
name: Build e2e tests

on:
  push:
    branches: [ develop ]
  pull_request:
    branches: [ develop]
    types: [opened, synchronize, reopened, labeled]
  workflow_dispatch:

jobs:
  build:
    runs-on: k8s-runner-e2e

    # We allow builds:
    # 1) When triggered manually
    # 2) When it's a merge into a branch
    # 3) For PRs that are labeled as build and
    #  - It's a code change
    #  - A build label was just added
    # A bit complex, but prevents builds when other labels are manipulated
    if: >
      github.event_name == 'workflow_dispatch'
      || github.event_name == 'push'
      || (contains(github.event.pull_request.labels.*.name, 'build')
         && (github.event.action != 'labeled' || github.event.label.name == 'build')
         )

    steps:
      # Pinned 1.0.0 version
      - uses: actions/checkout@v2.3.4
        with:
          path: plugin
      - name: Checkout e2e test repo
        uses: actions/checkout@v2.3.4
        with:
          repository: cdapio/cdap-e2e-tests
          path: e2e
      - name: Cache
        uses: actions/cache@v2.1.3
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ github.workflow }}-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            ${{ runner.os }}-maven-${{ github.workflow }}
      - name: Run tests
        run: python3 e2e/src/main/scripts/run_e2e_test.py
      - name: Upload report 
        uses: actions/upload-artifact@v2.2.4
        if: always()
        with:
          name: Cucumber report
          path: ./plugin/target/cucumber-reports
      - name: Upload debug files 
        uses: actions/upload-artifact@v2.2.4
        if: always()
        with:
          name: Debug files
          path: ./**/target/e2e-debug
      - name: Deploy report
        uses: peaceiris/actions-gh-pages@v3
        if: always()
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./plugin/target/cucumber-reports
          destination_dir: cucumber-reports/${{ github.ref }}
          
      - name: github-status-action
        uses: Sibz/github-status-action@67af1f4042a5a790681aad83c44008ca6cfab83d
        if: always()
        with:
          authToken: ${{ secrets.GITHUB_TOKEN }}
          state: success
          context: Cucumber report
          target_url: https://data-integrations.github.io/google-cloud/cucumber-reports/${{ github.ref }}/advanced-reports/cucumber-html-reports/overview-features.html
          sha: ${{github.event.pull_request.head.sha || github.sha}}

          
{'fraction_non_alphanumeric': 0.10573874445149017, 'fraction_numerical': 0.020133164235890934, 'mean_word_length': 2.3576370409792444, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '3275006', 'n_tokens_mistral': 2000, 'n_tokens_neox': 1899, 'n_words': 541}