# Copyright 2026 Google LLC
# SPDX-License-Identifier: Apache-2.0
#
# CI pipeline — lint, type-check, test, security scan.
#
# STATUS: DISABLED (manual trigger only).
# To enable on push/PR, uncomment the push/pull_request triggers below.
#
# This workflow runs inside the sample directory only — it does NOT
# require the full Genkit monorepo. Safe to use after copying the
# sample out as a standalone project.
name: CI
on:
workflow_dispatch: # Manual trigger only — remove to enable auto-run.
# Uncomment to run on push / PR:
# push:
# branches: [main]
# paths:
# - 'py/samples/web-endpoints-hello/**'
# pull_request:
# branches: [main]
# paths:
# - 'py/samples/web-endpoints-hello/**'
defaults:
run:
working-directory: py/samples/web-endpoints-hello
jobs:
lint:
name: Lint & Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install Python
run: uv python install 3.13
- name: Install dependencies
run: uv sync --extra dev --extra test
- name: Ruff format check
run: uv run ruff format --check --preview .
- name: Ruff lint
run: uv run ruff check --preview .
- name: Shellcheck
run: shellcheck -x *.sh scripts/*.sh
typecheck:
name: Type Check (${{ matrix.checker }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- checker: ty
command: uv run ty check .
- checker: pyrefly
command: uv run pyrefly check .
- checker: pyright
command: uv run pyright src/ tests/
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install Python
run: uv python install 3.13
- name: Install dependencies
run: uv sync --extra dev --extra test
- name: Run ${{ matrix.checker }}
run: ${{ matrix.command }}
test:
name: Test (Python ${{ matrix.python }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install Python ${{ matrix.python }}
run: uv python install ${{ matrix.python }}
- name: Install dependencies
run: uv sync --extra dev --extra test
- name: Run tests
run: uv run pytest tests/ -v --tb=short
security:
name: Security Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install Python
run: uv python install 3.13
- name: Install dependencies
run: uv sync --extra dev --extra test
- name: Vulnerability audit (pip-audit)
run: uv run pip-audit
- name: License compliance
run: >-
uv run pip-licenses
--allow-only="Apache-2.0;Apache Software License;MIT;MIT License;BSD License;BSD-3-Clause;BSD-2-Clause;PSF-2.0;ISC;Python-2.0;Python Software Foundation License;Mozilla Public License 2.0 (MPL 2.0)"