ci workflow (google-deepmind/chex)
The ci workflow from google-deepmind/chex, explained and optimized by Latchkey.
A
CI health: A - excellent
Run this on Latchkey for self-healing, caching, and up to 58% lower cost.
Grade your own workflow free or run it on Latchkey →What it does
This is the ci workflow from the google-deepmind/chex 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)
name: ci
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: '30 2 * * *'
permissions:
contents: read
actions: write # to cancel previous workflows
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
name: "Pytest ${{ matrix.python-version }} on ${{ matrix.os }} jax=${{ matrix.jax-version}}"
runs-on: "${{ matrix.os }}"
strategy:
matrix:
python-version: ["3.12", "3.13", "3.14"]
os: [ubuntu-latest]
jax-version: ["newest"]
include:
- python-version: "3.14"
os: "ubuntu-latest"
jax-version: "nightly"
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v5.3.0
with:
python-version: "${{ matrix.python-version }}"
- name: Run CI tests
run: JAX_VERSION="${{ matrix.jax-version }}" bash test.sh
shell: bash
The same workflow, on Latchkey
Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.
name: ci on: push: branches: ["main"] pull_request: branches: ["main"] schedule: - cron: '30 2 * * *' permissions: contents: read actions: write # to cancel previous workflows concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} cancel-in-progress: true jobs: build-and-test: name: "Pytest ${{ matrix.python-version }} on ${{ matrix.os }} jax=${{ matrix.jax-version}}" runs-on: "${{ matrix.os }}" strategy: matrix: python-version: ["3.12", "3.13", "3.14"] os: [ubuntu-latest] jax-version: ["newest"] include: - python-version: "3.14" os: "ubuntu-latest" jax-version: "nightly" steps: - uses: actions/checkout@v5 - uses: actions/setup-python@v5.3.0 with: cache: 'pip' python-version: "${{ matrix.python-version }}" - name: Run CI tests run: JAX_VERSION="${{ matrix.jax-version }}" bash test.sh shell: bash
What changed
- Cache dependency installs on the setup step so they are served from cache.
This workflow runs 1 job (3 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.