Files
2026-07-13 12:38:34 +08:00

86 lines
2.3 KiB
YAML

name: Checks
on:
push:
branches:
- master
paths:
- 'python/**/*.py'
- '.github/actions/setup-python-uv/action.yml'
- '.github/workflows/py.check.yaml'
- 'mise.toml'
- 'mise.lock'
pull_request:
types: [opened, synchronize]
paths:
- 'python/**/*.py'
- '.github/actions/setup-python-uv/action.yml'
- '.github/workflows/py.check.yaml'
- 'mise.toml'
- 'mise.lock'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
common-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 50
- name: Setup Python with UV
id: setup-python
uses: ./.github/actions/setup-python-uv
- name: nox cache
id: nox-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: python/.nox
key: nox-${{ hashFiles('pyproject.toml') }}-py${{ steps.setup-python.outputs.python-version }}
restore-keys: |
nox-
- name: Mypy cache
id: mypy-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: python/.mypy_cache
key: mypy-${{ hashFiles('pyproject.toml') }}-py${{ steps.setup-python.outputs.python-version }}
restore-keys: |
mypy-
- name: Ruff cache
id: ruff-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: python/.ruff_cache
key: ruff-${{ hashFiles('pyproject.toml') }}-py${{ steps.setup-python.outputs.python-version }}
restore-keys: |
ruff-
- name: Install deps
run: |
cd python/
make env
- name: Lint and type checks
shell: bash
run: |
cd python/
uv run nox -s chk
- name: Type inference tests
shell: bash
run: |
cd python/
uv run nox -s type_inference
env:
COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY }}