# tests_entry.yml
# Entry point to the test suites
#
# - If neither ci:run, ci:run_full or ci:ready_to_merge labels are on PR, fail and exit.
# - If the PR comment body doesn't contain 'BUG=' fail and exit.
# - If ci:run or ci:run_full label is on PR, remove label and run the test scripts.
# - If ci:ready_to_merge is on the PR and the pull_request_target type is synchronize not triggered
#   by the mergify[bot] user, remove label and fail job.
# - If ci:ready_to_merge label is on PR and pull_request_target type is labeled, run the test scripts.
#
# The end result is labeling ci:run or ci:ready_to_merge will run the test scripts,
# If Mergify merges to the PR, the test scripts will run. If anyone else tries to add
# a commit to the PR or merge , the script will fail and ci:ready_to_merge will be
# removed.
#
# This script runs the test scripts directly. Scheduled or manual runs use
# run_<scriptname>.yml as the entry point.

name: Tests Entry Point
on:
  pull_request_target:
    types:
      - synchronize
      - labeled

jobs:
  no-labels:
    runs-on: ubuntu-latest
    steps:
      - name: fail-without-labels
        if: ${{ !(contains(github.event.pull_request.labels.*.name, 'ci:run') ||
          contains(github.event.pull_request.labels.*.name, 'ci:ready_to_merge') ||
          contains(github.event.pull_request.labels.*.name, 'ci:run_full')) }}
        run: exit 1

  ci-ready-to-merge:
    runs-on: ubuntu-latest
    needs: no-labels
    steps:
      - name: remove-ready-to-merge
        if: ${{ (contains(github.event.pull_request.labels.*.name, 'ci:ready_to_merge') &&
            (github.event.action == 'synchronize') &&
            !(github.event.sender.login == 'mergify[bot]')) }}
        uses: actions/github-script@v5
        with:
          github-token: ${{ secrets.TFLM_BOT_REPO_TOKEN }}
          script: |
            github.rest.issues.removeLabel({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              name: 'ci:ready_to_merge'
            })
      - name: fail-on-bad-synch
        if: ${{ (github.event.action == 'synchronize') && !(github.event.sender.login == 'mergify[bot]') }}
        run: exit 1

  ci-run:
    runs-on: ubuntu-latest
    needs: ci-ready-to-merge
    steps:
      - name: remove-cirun
        if: ${{ contains(github.event.pull_request.labels.*.name, 'ci:run') }}
        uses: actions/github-script@v5
        with:
          github-token: ${{ secrets.TFLM_BOT_REPO_TOKEN }}
          script: |
            github.rest.issues.removeLabel({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              name: 'ci:run'
            })
        continue-on-error: true

  ci-run-full:
    runs-on: ubuntu-latest
    needs: ci-run
    steps:
      - name: remove-cirun-full
        if: ${{ contains(github.event.pull_request.labels.*.name, 'ci:run_full') }}
        uses: actions/github-script@v5
        with:
          github-token: ${{ secrets.TFLM_BOT_REPO_TOKEN }}
          script: |
            github.rest.issues.removeLabel({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              name: 'ci:run_full'
            })
        continue-on-error: true

  pr-has-bug:
    runs-on: ubuntu-latest
    needs: ci-run-full
    name: PR has Bug
    steps:
      - name: Check for BUG=
        if: ${{ !contains(github.event.pull_request.body, 'BUG=') }}
        run: |
          echo "PR description requires a BUG= line with issue number."
          echo "See https://testing.googleblog.com/2017/09/code-health-providing-context-with.html for additional context"
          exit 1
  
  call-ci:
    needs: ci-run
    uses: ./.github/workflows/ci.yml
    with:
      trigger-sha: ${{ github.event.pull_request.head.sha }}

  call-hexagon:
    needs: ci-run
    uses: ./.github/workflows/hexagon.yml
    with:
      trigger-sha: ${{ github.event.pull_request.head.sha }}
    secrets:
      tflm-bot-token: ${{ secrets.TFLM_BOT_PACKAGE_READ_TOKEN }}

  call-xtensa-presubmit:
    needs: ci-run
    uses: ./.github/workflows/xtensa_presubmit.yml
    with:
      trigger-sha: ${{ github.event.pull_request.head.sha }}
    secrets:
      tflm-bot-token: ${{ secrets.TFLM_BOT_PACKAGE_READ_TOKEN }}

  call-check-tflite-files:
    needs: ci-run
    uses: ./.github/workflows/check_tflite_files.yml
    with: 
      trigger-sha: ${{ github.event.pull_request.head.sha }}
      pr-number: ${{ github.event.pull_request.number }}
      pr-body: ${{ github.event.pull_request.body }}
    secrets:
      tflm-bot-token: ${{ secrets.TFLM_BOT_PACKAGE_READ_TOKEN }}
