<commit_before>name: Sync from tflite-micro

on:
  schedule:
    - cron: 0 0 * * *

  # Allow manually triggering of the workflow.
  workflow_dispatch: {}

jobs:
  sync-tflite-micro:
    runs-on: ubuntu-latest

    if: |
      github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'

    env:
      GH_SERVICE_ACCOUNT_NAME: "GitHub"
      GH_SERVICE_ACCOUNT_EMAIL: "<EMAIL>"

    steps:
      - name: Clone repository
        uses: actions/checkout@v2
        with:
          ssh-key: ${{ secrets.SSH_DEPLOY_KEY }}

      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: '3.7'

      - name: Configure git
        run: |
          git config --global user.name $GH_SERVICE_ACCOUNT_NAME
          git config --global user.email $GH_SERVICE_ACCOUNT_EMAIL

      - name: Sync the code, commit and push
        run: |
          export TFLM_SHA=$(git ls-remote https://github.com/tensorflow/tflite-micro.git main | cut -c1-7)
          ./scripts/sync_from_tflite_micro.sh
          git add *

          if [ -n "$(git status --porcelain)" ]; then
            git commit -sm "Sync from tflite-micro at $TFLM_SHA."
          else
            echo "no changes"
          fi

      - name: Create Pull Request
        id: create-pr
        uses: peter-evans/create-pull-request@v3
        with:
          branch: sync-from-tflite-micro
          base: main
          delete-branch: true
          signoff: true
          token: ${{ secrets.GITHUB_TOKEN }}
          title: (CFU Playground) Automated sync from github.com/tensorflow/tflite-micro
          commit-message: Automated sync from github.com/tensorflow/tflite-micro
          body: "(CFU Playground) Automated sync from github.com/tensorflow/tflite-micro"<commit_msg>sync-tflm: Setup prerequisites for the job<commit_after>name: Sync from tflite-micro

on:
  schedule:
    - cron: 0 0 * * *

  # Allow manually triggering of the workflow.
  workflow_dispatch: {}

jobs:
  sync-tflite-micro:
    runs-on: ubuntu-latest

    if: |
      github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'

    env:
      GH_SERVICE_ACCOUNT_NAME: "GitHub"
      GH_SERVICE_ACCOUNT_EMAIL: "<EMAIL>"

    steps:
      - name: Clone repository
        uses: actions/checkout@v2
        with:
          ssh-key: ${{ secrets.SSH_DEPLOY_KEY }}

      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: '3.7'

      - name: Setup environment
        run: bash scripts/setup -ci

      - name: Configure git
        run: |
          git config --global user.name $GH_SERVICE_ACCOUNT_NAME
          git config --global user.email $GH_SERVICE_ACCOUNT_EMAIL

      - name: Sync the code, commit and push
        run: |
          source environment
          python3 -m pip install -r conf/requirements.txt
          export TFLM_SHA=$(git ls-remote https://github.com/tensorflow/tflite-micro.git main | cut -c1-7)
          ./scripts/sync_from_tflite_micro.sh
          git add *

          if [ -n "$(git status --porcelain)" ]; then
            git commit -sm "Sync from tflite-micro at $TFLM_SHA."
          else
            echo "no changes"
          fi

      - name: Create Pull Request
        id: create-pr
        uses: peter-evans/create-pull-request@v3
        with:
          branch: sync-from-tflite-micro
          base: main
          delete-branch: true
          signoff: true
          token: ${{ secrets.GITHUB_TOKEN }}
          title: (CFU Playground) Automated sync from github.com/tensorflow/tflite-micro
          commit-message: Automated sync from github.com/tensorflow/tflite-micro
          body: "(CFU Playground) Automated sync from github.com/tensorflow/tflite-micro"
{'fraction_non_alphanumeric': 0.09811220420101037, 'fraction_numerical': 0.0050518479127891515, 'mean_word_length': 2.0071942446043165, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '2951654', 'n_tokens_mistral': 1245, 'n_tokens_neox': 1168, 'n_words': 291}