Skip to content

Run Pre Merge

Run Pre Merge #34

Workflow file for this run

# Helpful YAML parser to clarify YAML syntax:
# https://yaml-online-parser.appspot.com/
name: Run Pre Merge
on:
merge_group:
pull_request:
types: [labeled]
branches: ["main"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
check-ci-run-label:
name: Check ci:run label
runs-on: ubuntu-latest
steps:
- name: fail-without-ci_run
if: ${{ (github.event.action == 'labeled') && !(contains(github.event.pull_request.labels.*.name, 'ci:run')) }}
run: exit 1
remove-ci-run-label:
name: Remove ci:run label
runs-on: ubuntu-latest
needs: check-ci-run-label
steps:
- name: remove-cirun
if: ${{ contains(github.event.pull_request.labels.*.name, 'ci:run') }}
uses: actions/github-script@v5
with:
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
check-pr-description-has-bug:
runs-on: ubuntu-latest
needs: remove-ci-run-label
name: Check PR description has BUG=
steps:
- name: Check for BUG=
if: ${{ (github.event.action == 'labeled') && !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
run-formatting:
name: Formatting
needs: remove-ci-run-label
uses: ./.github/workflows/formatting.yml
with:
trigger-sha: ${{ github.event.pull_request.head.sha }}
run-generative-api-examples:
name: Generative API Examples
needs: remove-ci-run-label
uses: ./.github/workflows/generative_api_examples.yml
with:
trigger-sha: ${{ github.event.pull_request.head.sha }}
run-unittests-python:
name: Unit Tests Python
needs: remove-ci-run-label
uses: ./.github/workflows/unittests_python.yml
with:
trigger-sha: ${{ github.event.pull_request.head.sha }}
run-model-coverage:
name: Model Coverage
needs: remove-ci-run-label
if: contains(github.event.pull_request.labels.*.name, 'ci:model-coverage')
uses: ./.github/workflows/model_coverage.yml
secrets: inherit
with:
trigger-sha: ${{ github.event.pull_request.head.sha }}