Skip to content
49 changes: 49 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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.

# Summary: configure actionlint (https://github.com/rhysd/actionlint) to
# recognize action runner names/labels that we use.

self-hosted-runner:
labels:
# Google self-hosted runners defined in TensorFlow org.
- linux-x86-n2-32

# Defined in Quantumlib org.
- ubuntu-22.04-arm64-2-core
- ubuntu-22.04-arm64-8-core
- ubuntu-22.04-arm64-16-core

- ubuntu-22.04-x64-2-core
- ubuntu-22.04-x64-8-core
- ubuntu-22.04-x64-16-core

- ubuntu-24.04-arm64-2-core
- ubuntu-24.04-arm64-8-core
- ubuntu-24.04-arm64-16-core

- ubuntu-24.04-x64-2-core
- ubuntu-24.04-x64-8-core
- ubuntu-24.04-x64-16-core

- windows-2022-x64-8-core
- windows-2025-x64-8-core
- windows-2025-x64-16-core

# From https://github.com/actions/partner-runner-images
- ubuntu-24.04-arm

# New from GitHub (late 2025) but currently not known by actionlint.
# https://docs.github.com/en/actions/reference/runners/github-hosted-runners
- ubuntu-slim
112 changes: 66 additions & 46 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:
branches:
- main

workflow_dispatch:

concurrency:
# Cancel any previously-started but still active runs on the same branch.
cancel-in-progress: true
Expand All @@ -27,31 +29,35 @@ permissions: read-all

jobs:
pytest:
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-x64-8-core
timeout-minutes: 20
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: ts-graphviz/setup-graphviz@c001ccfb5aff62e28bda6a6c39b59a7e061be5b9 # v1
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: ts-graphviz/setup-graphviz@b1de5da23ed0a6d14e0aeee8ed52fdd87af2363c # v2.0.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
python-version-file: "pyproject.toml"
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
- name: Install dependencies
run: |
uv sync --frozen --no-dev --group test
- run: |
uv run --no-sync check/pytest-quick

dev-tools:
runs-on: ubuntu-24.04
runs-on: ubuntu-slim
timeout-minutes: 15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: ts-graphviz/setup-graphviz@c001ccfb5aff62e28bda6a6c39b59a7e061be5b9 # v1
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: ts-graphviz/setup-graphviz@b1de5da23ed0a6d14e0aeee8ed52fdd87af2363c # v2.0.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
python-version-file: "pyproject.toml"
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
- name: Install dependencies
run: |
uv sync --frozen
Expand All @@ -60,15 +66,17 @@ jobs:
uv run --no-sync check/mypy-dev-tools

notebooks:
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-x64-8-core
timeout-minutes: 15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: ts-graphviz/setup-graphviz@c001ccfb5aff62e28bda6a6c39b59a7e061be5b9 # v1
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: ts-graphviz/setup-graphviz@b1de5da23ed0a6d14e0aeee8ed52fdd87af2363c # v2.0.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
python-version-file: "pyproject.toml"
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
- name: Install dependencies
run: |
uv sync --frozen --no-dev --group test
Expand All @@ -78,16 +86,18 @@ jobs:
NUMBA_NUM_THREADS: 4

format:
runs-on: ubuntu-24.04
runs-on: ubuntu-slim
timeout-minutes: 15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
python-version-file: "pyproject.toml"
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
- name: Install dependencies
run: |
uv sync --frozen --no-dev --group format
Expand All @@ -100,13 +110,15 @@ jobs:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version-file: "pyproject.toml"
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
enable-cache: true
- name: Install dependencies
run: |
uv sync --frozen --no-dev --group lint
Expand All @@ -116,14 +128,16 @@ jobs:
uv run --no-sync check/pylint

ruff:
runs-on: ubuntu-24.04
runs-on: ubuntu-slim
timeout-minutes: 5
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version-file: "pyproject.toml"
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
enable-cache: true
- name: Install dependencies
run: |
uv sync --frozen --no-dev --group lint
Expand All @@ -134,13 +148,15 @@ jobs:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
python-version-file: "pyproject.toml"
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
- name: Install dependencies
run: |
uv sync --frozen --no-dev --group typing
Expand All @@ -150,15 +166,17 @@ jobs:
uv run --no-sync check/mypy

autogenerate-notebooks:
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-x64-8-core
timeout-minutes: 15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: ts-graphviz/setup-graphviz@c001ccfb5aff62e28bda6a6c39b59a7e061be5b9 # v1
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: ts-graphviz/setup-graphviz@b1de5da23ed0a6d14e0aeee8ed52fdd87af2363c # v2.0.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
python-version-file: "pyproject.toml"
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
- name: Install dependencies
run: |
uv sync --frozen --no-dev --group doc
Expand All @@ -169,11 +187,13 @@ jobs:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version-file: "pyproject.toml"
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
enable-cache: true
- name: Install minimal dependencies
run: |
uv venv .venv-minimal
Expand Down
Loading