Skip to content
Latchkey

Tunix Nightly Regression Tests workflow (google/tunix)

The Tunix Nightly Regression Tests workflow from google/tunix, explained and optimized by Latchkey.

A

CI health: A - excellent

Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: google/tunix.github/workflows/build_and_test_tunix_nightly_regression.ymlLicense Apache-2.0View source

What it does

This is the Tunix Nightly Regression Tests workflow from the google/tunix repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
# Copyright 2025 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.

# This workflow will build tunix python package and run tpu regression tests.

name: Tunix Nightly Regression Tests

on:
  workflow_dispatch:
  schedule:
    # Run the job every day at 2am
    - cron:  '0 10 * * *' # 10:00 AM UTC, 2:00 AM PST

concurrency:
  # Dedup scheduled runs but nothing else
  group: >
    ${{
      github.event_name == 'schedule' && format('{0}-schedule', github.workflow) ||
      github.run_id
    }}
  cancel-in-progress: false

permissions:
  contents: read
jobs:
  build_tunix_package:
    name: Build tunix package
    uses: ./.github/workflows/build_package.yml

  tunix_tpu_nightly_regression:
    needs: build_tunix_package
    uses: ./.github/workflows/tpu-nightly-regression.yml
    secrets:
      HF_TOKEN: ${{ secrets.HF_TOKEN }}
      KAGGLE_USERNAME: ${{ secrets.KAGGLE_USERNAME }}
      KAGGLE_KEY: ${{ secrets.KAGGLE_KEY }}

  notify_failure:
    name: Notify failed build # creates an issue or modifies last open existing issue for failed build
    needs: [build_tunix_package, tunix_tpu_nightly_regression]
    if: ${{ always() }}
    runs-on: ubuntu-latest
    permissions:
      issues: write
    steps:
    - name: Check whether one of the jobs failed
      if: ${{ contains(needs.*.result, 'failure') && github.event.pull_request == null && github.event_name != 'workflow_dispatch' }}
      uses: jayqi/failed-build-issue-action@1a893bbf43ef1c2a8705e2b115cd4f0fe3c5649b  # v1.2.0
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

# Copyright 2025 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.
 
# This workflow will build tunix python package and run tpu regression tests.
 
name: Tunix Nightly Regression Tests
 
on:
  workflow_dispatch:
  schedule:
    # Run the job every day at 2am
    - cron:  '0 10 * * *' # 10:00 AM UTC, 2:00 AM PST
 
concurrency:
  # Dedup scheduled runs but nothing else
  group: >
    ${{
      github.event_name == 'schedule' && format('{0}-schedule', github.workflow) ||
      github.run_id
    }}
  cancel-in-progress: false
 
permissions:
  contents: read
jobs:
  build_tunix_package:
    timeout-minutes: 30
    name: Build tunix package
    uses: ./.github/workflows/build_package.yml
 
  tunix_tpu_nightly_regression:
    timeout-minutes: 30
    needs: build_tunix_package
    uses: ./.github/workflows/tpu-nightly-regression.yml
    secrets:
      HF_TOKEN: ${{ secrets.HF_TOKEN }}
      KAGGLE_USERNAME: ${{ secrets.KAGGLE_USERNAME }}
      KAGGLE_KEY: ${{ secrets.KAGGLE_KEY }}
 
  notify_failure:
    timeout-minutes: 30
    name: Notify failed build # creates an issue or modifies last open existing issue for failed build
    needs: [build_tunix_package, tunix_tpu_nightly_regression]
    if: ${{ always() }}
    runs-on: latchkey-small
    permissions:
      issues: write
    steps:
    - name: Check whether one of the jobs failed
      if: ${{ contains(needs.*.result, 'failure') && github.event.pull_request == null && github.event_name != 'workflow_dispatch' }}
      uses: jayqi/failed-build-issue-action@1a893bbf43ef1c2a8705e2b115cd4f0fe3c5649b  # v1.2.0
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
 

What changed

This workflow runs 3 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.