forked from scanny/python-pptx
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (98 loc) · 3.26 KB
/
ci.yml
File metadata and controls
105 lines (98 loc) · 3.26 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: ci
# Runs on every push to a branch in this repo and on every pull request
# targeting master. Tags push the same code through publish.yml separately.
on:
push:
branches:
- master
- develop
- "release/**"
- "feature/**"
- "ci/**"
pull_request:
branches:
- master
workflow_dispatch:
permissions:
contents: read
jobs:
lint:
name: Lint (ruff)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
# ---uv tool run auto-installs on first invocation; no separate install step needed---
- name: ruff check
run: uv tool run ruff check src tests
- name: ruff format check
run: uv tool run ruff format --check src tests
typecheck:
name: Typecheck (pyright strict — public API)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Set up Python
run: uv python install 3.12
- name: Sync dev dependencies
run: uv sync --extra dev
# ---public-API surface: pptx/__init__.py is the literal entrypoint
# ---resolved by `from pptx import Presentation`, plus the modules
# ---it pulls in (api, presentation, util, exc, types).
# ---Strict-mode pyright on the broader codebase still surfaces several
# ---thousand findings (reportUnknownMemberType-heavy in chart and
# ---oxml.simpletypes); those are tracked as future work, not this gate.
- name: pyright (public-API entry points)
run: |
uv run pyright src/pptx/__init__.py src/pptx/api.py src/pptx/presentation.py \
src/pptx/util.py src/pptx/exc.py src/pptx/types.py
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Sync test dependencies
run: uv sync --extra test --python ${{ matrix.python-version }}
- name: Display Python version
run: uv run python -c "import sys; print(sys.version)"
- name: Unit + integration tests (pytest)
run: uv run pytest --cov=pptx --cov-report=term-missing tests
- name: Acceptance tests (behave)
run: uv run behave --stop
build-check:
name: Build sdist and wheel (smoke)
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Build distributions
run: uv build
- name: Verify metadata renders
run: uv tool run --from twine twine check dist/*
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ github.sha }}
path: dist/
retention-days: 7