Skip to content

Add test without optional dependencies #2346

Add test without optional dependencies

Add test without optional dependencies #2346

Workflow file for this run

name: CI
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
schedule:
- cron: "15 22 * * *"
workflow_dispatch: {} # support manual runs
permissions:
contents: read
jobs:
ci:
name: CI
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
resolution: ["highest", "lowest-direct"]
env:
# Shared env variables for all the tests
UV_RESOLUTION: "${{ matrix.resolution }}"
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: stable
# We use this to install certain tools defined in poe tasks
cache-dependency-path: poe_tasks.toml
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
python-version: ${{ matrix.python-version }}
- run: uv sync
- run: uv run poe test
# Ensure tests pass without optional dependencies. Issues would come from eager imports, so we go ahead
# and run the single conformance test only to keep this step lightweight and give high coverage.
- run: |
uv sync --no-dev
uv run --no-dev --group dev-required pytest -k test_conformance
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: stable
# We use this to install certain tools defined in poe tasks
cache-dependency-path: poe_tasks.toml
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
python-version: ${{ matrix.python-version }}
- run: uv sync --locked
- run: uv run poe lint
- run: uv run poe format
- run: uv run poe generate
env:
BUF_TOKEN: ${{ secrets.BUF_TOKEN }}
- run: uv run poe diffcheck