Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/build_and_test_maxtext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
pull_request:
workflow_call:
workflow_dispatch:
inputs:
force_scheduled_run:
type: boolean
default: false
schedule:
# Run the job every 4 hours
- cron: '0 */4 * * *'
Expand Down Expand Up @@ -154,7 +158,7 @@ jobs:
with:
flavor: ${{ matrix.flavor }}
base_image: maxtext-unit-test-tpu:py312
is_scheduled_run: ${{ github.event_name == 'schedule' }}
is_scheduled_run: ${{ github.event_name == 'schedule' || github.event.inputs.force_scheduled_run == 'true' }}
maxtext_sha: ${{ needs.build_and_upload_maxtext_package.outputs.maxtext_sha }}

gpu-tests:
Expand All @@ -169,7 +173,7 @@ jobs:
with:
flavor: ${{ matrix.flavor }}
base_image: maxtext-unit-test-cuda12:py312
is_scheduled_run: ${{ github.event_name == 'schedule' }}
is_scheduled_run: ${{ github.event_name == 'schedule' || github.event.inputs.force_scheduled_run == 'true' }}
maxtext_sha: ${{ needs.build_and_upload_maxtext_package.outputs.maxtext_sha }}

cpu-tests:
Expand All @@ -184,7 +188,7 @@ jobs:
with:
flavor: ${{ matrix.flavor }}
base_image: maxtext-unit-test-tpu:py312
is_scheduled_run: ${{ github.event_name == 'schedule' }}
is_scheduled_run: ${{ github.event_name == 'schedule' || github.event.inputs.force_scheduled_run == 'true' }}
maxtext_sha: ${{ needs.build_and_upload_maxtext_package.outputs.maxtext_sha }}

maxtext_tpu_pathways_unit_tests:
Expand All @@ -203,7 +207,7 @@ jobs:
xla_python_client_mem_fraction: 0.75
tf_force_gpu_allow_growth: false
container_resource_option: "--privileged"
is_scheduled_run: ${{ github.event_name == 'schedule' }}
is_scheduled_run: ${{ github.event_name == 'schedule' || github.event.inputs.force_scheduled_run == 'true' }}
maxtext_sha: ${{ needs.build_and_upload_maxtext_package.outputs.maxtext_sha }}

maxtext_tpu_pathways_integration_tests:
Expand All @@ -222,7 +226,7 @@ jobs:
xla_python_client_mem_fraction: 0.75
tf_force_gpu_allow_growth: false
container_resource_option: "--privileged"
is_scheduled_run: ${{ github.event_name == 'schedule' }}
is_scheduled_run: ${{ github.event_name == 'schedule' || github.event.inputs.force_scheduled_run == 'true' }}
maxtext_sha: ${{ needs.build_and_upload_maxtext_package.outputs.maxtext_sha }}

all_tests_passed:
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/pr_comment_commands.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Copyright 2026 Google LLC
#
# 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
#
# https://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.

name: PR Comment Commands

on:
issue_comment:
types: [created]

permissions:
actions: write
pull-requests: write
issues: write
contents: read

jobs:
trigger_workflows:
name: Trigger Workflows via Comment
# Only run if it's a pull request comment, and the author is a collaborator/member/owner
if: |
github.event.issue.pull_request != null &&
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
runs-on: ubuntu-latest
steps:
- name: Parse and Dispatch Comment Command
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMENT_BODY: ${{ github.event.comment.body }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
REPO: ${{ github.repository }}
run: |
# Normalize comment body (lowercase, trim whitespace)
COMMENT=$(echo "$COMMENT_BODY" | tr '[:upper:]' '[:lower:]' | xargs)

echo "Processing comment: '$COMMENT'"

# Get PR branch name using gh CLI
PR_BRANCH=$(gh pr view "$ISSUE_NUMBER" --json headRefName --jq '.headRefName' --repo "$REPO")
echo "PR branch ref is '$PR_BRANCH'"

MATCHED=false
WORKFLOW_NAME=""
PARAMS=()

# 1. Match "test this please" / "test this pr" / "run tests"
if [[ "$COMMENT" =~ ^(test this please|test this pr|run tests)$ ]]; then
MATCHED=true
WORKFLOW_NAME="build_and_test_maxtext.yml"
PARAMS=(-f force_scheduled_run=false)

# 2. Match "run scheduled tests"
elif [[ "$COMMENT" == "run scheduled tests" ]]; then
MATCHED=true
WORKFLOW_NAME="build_and_test_maxtext.yml"
PARAMS=(-f force_scheduled_run=true)
fi

if [ "$MATCHED" = "true" ]; then
echo "Dispatching workflow $WORKFLOW_NAME with parameters: ${PARAMS[*]}"

# Dispatch the workflow
gh workflow run "$WORKFLOW_NAME" --ref "$PR_BRANCH" "${PARAMS[@]}" --repo "$REPO"
else
echo "No matching command found in comment."
fi
1 change: 1 addition & 0 deletions .github/workflows/run_jupyter_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
MAXTEXT_INSTALLED: ${{ inputs.maxtext_installed }}
# TODO: Fix evaluation in sft_qwen3_demo.ipynb and remove this env variable
RUN_EVALUATION: "False"
CI_STEPS: "2"
run: |
if [ "${MAXTEXT_INSTALLED}" == "true" ]; then
# Move to the directory where code is baked into the image. See the Dockerfile.
Expand Down
Loading
Loading