-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (45 loc) · 1.61 KB
/
Copy pathpython.yml
File metadata and controls
55 lines (45 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Python
on:
push:
branches: [main]
paths:
- 'python/**'
- 'conformance/**'
- 'examples/**'
- '.github/workflows/python.yml'
pull_request:
paths:
- 'python/**'
- 'conformance/**'
- 'examples/**'
- '.github/workflows/python.yml'
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: python
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v9.0.0 # no bare v8 alias tag exists (v1-v7 only)
with:
enable-cache: true
- run: uv sync --locked
# `coverage run -m pytest` (not `pytest --cov`) so coverage is armed before
# pytest autoloads the varar_pytest plugin; `coverage report` enforces
# fail_under. See python/pyproject.toml.
- run: uv run coverage run -m pytest && uv run coverage report
- run: uv run ruff check
- run: uv run python scripts/lint_no_reexports.py
# Standalone sample projects (see examples/python-*).
- run: uv run pytest
working-directory: examples/python-pytest
- run: uv run python -m unittest
working-directory: examples/python-unittest
# The adapter smoke contract: the golden corpora only see the pure core, so an
# adapter can be conformance-green and still test nothing. This runs the sample's
# real test command against a deliberately drifted baseline and requires it to go
# red. See conformance/adapter/README.md.
- run: conformance/adapter/smoke.sh examples/python-pytest examples/python-unittest
working-directory: .