Skip to content

Add web benchmarking to LiteRT CLI #240

Add web benchmarking to LiteRT CLI

Add web benchmarking to LiteRT CLI #240

Workflow file for this run

# Copyright 2026 The LiteRT CLI Authors.
#
# 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.
# ==============================================================================
# Helpful YAML parser to clarify YAML syntax:
# https://yaml-online-parser.appspot.com/
name: Run Pre Merge
on:
pull_request:
# Triggered by default activities (synchronize, opened, reopened) + labeled.
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
types: [labeled, synchronize, opened, reopened]
branches: ["main"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
block-pr-merge:
name: Block GitHub PR Merge
runs-on: ubuntu-latest
steps:
- run: exit 1
check-ci-run-label:
name: Check ci:run label
runs-on: ubuntu-latest
steps:
- run: echo "Run on branch $BRANCH_NAME by $PR_AUTHOR"
env:
BRANCH_NAME: ${{ github.head_ref }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
- name: fail-without-ci_run
if: ${{ !((github.event.pull_request.user.login == 'copybara-service[bot]') || 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
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 }}