Repository navigation
60 lines (56 loc) · 1.64 KB
/
Copy pathci.yml
File metadata and controls
60 lines (56 loc) · 1.64 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
name: CI
on:
pull_request:
push:
branches: [main, next, beta]
permissions:
contents: read
jobs:
test:
name: Python ${{ matrix.python }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
# Oldest supported (requires-python >=3.10), the main dev version, newest.
python: ['3.10', '3.12', '3.13']
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.2.0
with:
version: 'latest'
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: uv sync --all-groups --python ${{ matrix.python }}
- name: Lint
run: uv run ruff check .
- name: Typecheck
run: uv run mypy src
- name: Test
run: uv run pytest
package:
name: Build package
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.2.0
with:
version: 'latest'
- name: uv build
run: uv build
- name: Check contents
run: |
ls -la dist
python3 - <<'EOF'
import sys, zipfile, glob
whl = glob.glob("dist/*.whl")[0]
names = zipfile.ZipFile(whl).namelist()
print(len(names), "files in", whl)
if not any(n.startswith("norbix_python/") for n in names):
sys.exit("::error::norbix_python package missing from the wheel")
leaked = [n for n in names if n.startswith(("tests/", "references/", "docs/"))]
if leaked:
sys.exit(f"::error::files that must not ship: {leaked}")
EOF