11name : ci
22
3+ # Runs on every push to a branch in this repo and on every pull request
4+ # targeting master. Tags push the same code through publish.yml separately.
5+
36on :
4- pull_request :
5- branches : [ master ]
67 push :
78 branches :
89 - master
910 - develop
11+ - " release/**"
12+ - " feature/**"
13+ - " ci/**"
14+ pull_request :
15+ branches :
16+ - master
17+ workflow_dispatch :
1018
1119permissions :
12- contents : write
20+ contents : read
1321
1422jobs :
23+ lint :
24+ name : Lint (ruff)
25+ runs-on : ubuntu-latest
26+ steps :
27+ - uses : actions/checkout@v4
28+ - name : Set up Python
29+ uses : actions/setup-python@v5
30+ with :
31+ python-version : " 3.12"
32+ - name : Install ruff
33+ run : python -m pip install --upgrade ruff
34+ - name : ruff check
35+ run : ruff check src tests
36+ - name : ruff format check
37+ run : ruff format --check src tests
38+ continue-on-error : true # advisory until format pass is run repo-wide
1539
16- build :
40+ test :
41+ name : Test (Python ${{ matrix.python-version }})
1742 runs-on : ubuntu-latest
1843 strategy :
44+ fail-fast : false
1945 matrix :
2046 python-version : ["3.9", "3.10", "3.11", "3.12"]
2147 steps :
@@ -26,11 +52,35 @@ jobs:
2652 python-version : ${{ matrix.python-version }}
2753 - name : Display Python version
2854 run : python -c "import sys; print(sys.version)"
29- - name : Install test dependencies
55+ - name : Install package and test deps
3056 run : |
31- pip install .
32- pip install -r requirements-test.txt
33- - name : Test with pytest
34- run : pytest --cov=pptx --cov-report term-missing tests
35- - name : Acceptance tests with behave
57+ python -m pip install --upgrade pip
58+ python -m pip install -e .
59+ python -m pip install -r requirements-test.txt
60+ - name : Unit + integration tests (pytest)
61+ run : pytest --cov=pptx --cov-report=term-missing tests
62+ - name : Acceptance tests (behave)
3663 run : behave --stop
64+
65+ build-check :
66+ name : Build sdist and wheel (smoke)
67+ runs-on : ubuntu-latest
68+ needs : test
69+ steps :
70+ - uses : actions/checkout@v4
71+ - name : Set up Python
72+ uses : actions/setup-python@v5
73+ with :
74+ python-version : " 3.12"
75+ - name : Install build tooling
76+ run : python -m pip install --upgrade build twine
77+ - name : Build distributions
78+ run : python -m build
79+ - name : Verify metadata renders
80+ run : python -m twine check dist/*
81+ - name : Upload build artifacts
82+ uses : actions/upload-artifact@v4
83+ with :
84+ name : dist-${{ github.sha }}
85+ path : dist/
86+ retention-days : 7
0 commit comments