Repository navigation
80 lines (71 loc) · 2.78 KB
/
Copy pathci.yml
File metadata and controls
80 lines (71 loc) · 2.78 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- '**'
permissions:
contents: read
jobs:
package:
name: Build and test distributions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
python-version: '3.10'
activate-environment: true
- name: Install locked dependencies
run: uv sync --locked --no-default-groups --group compiler --group test --extra compiler --no-install-project --no-build
- name: Build and inspect distributions
run: |
uv build
python - <<'PY'
from pathlib import Path
import tarfile
import zipfile
with zipfile.ZipFile(next(Path("dist").glob("*.whl"))) as wheel:
names = wheel.namelist()
for resource in (
"aristaproto/py.typed",
"aristaproto/templates/header.py.j2",
"aristaproto/templates/template.py.j2",
):
assert resource in names, resource
assert any(name.endswith("/LICENSE.md") for name in names)
with tarfile.open(next(Path("dist").glob("*.tar.gz"))) as sdist:
assert any(name.endswith("/LICENSE.md") for name in sdist.getnames())
PY
- name: Install built wheel
run: uv pip install --no-deps --no-build --no-index ./dist/*.whl
- name: Test built wheel
run: |
uv run --no-sync --no-build --no-default-groups python -m tests.generate -v
uv run --no-sync --no-build --no-default-groups python -m pytest tests/
tests:
name: ${{ matrix.os }} / ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [Ubuntu, MacOS, Windows]
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
python-version: ${{ matrix.python-version }}
activate-environment: true
- name: Install locked compiler and test dependencies
run: uv sync --locked --no-default-groups --group compiler --group test --extra compiler --no-build
- name: Generate code from proto files
run: uv run --no-sync --no-build --no-default-groups python -m tests.generate -v
- name: Execute test suite
run: uv run --no-sync --no-build --no-default-groups python -m pytest tests/