File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ Name : Reusable Python packaging tests
2+
3+ on :
4+ workflow_call :
5+ additional_apt_packages :
6+ description : ' Additional APT packages to install'
7+ required : false
8+ type : string
9+ default : ' '
10+ working_directory :
11+ description : ' Working directory to use (default if unspecified)'
12+ required : false
13+ type : string
14+ default : ' .'
15+ cli_test_cmd :
16+ description : ' CLI test command to run'
17+ default : ' '
18+ type : string
19+
20+ jobs :
21+ name : Python packaging
22+ runs-on : ubuntu-24.04
23+ steps :
24+ - name : Cancel Previous Runs
25+ uses : styfle/cancel-workflow-action@0.12.1
26+ with :
27+ access_token : ${{ github.token }}
28+
29+ - uses : actions/checkout@v4.2.2
30+
31+ - name : Install additional APT packages
32+ if : ${{ inputs.additional_apt_packages != '' }}
33+ run : sudo apt-get update && sudo apt-get install -y ${{ inputs.additional_commands }}
34+
35+ - uses : actions/setup-python@v5.4.0
36+ with :
37+ python-version : ' 3.12'
38+
39+ - name : Install build deps
40+ run : |
41+ pip install uv
42+ uv pip install --system build twine validate-pyproject[all]
43+
44+ - name : Check package
45+ working-directory : ${{ inputs.working_directory }}
46+ run : |
47+ validate-pyproject pyproject.toml
48+ python -m build
49+ python -m twine check --strict dist/*
50+
51+ - name : Install
52+ working-directory : ${{ inputs.working_directory }}
53+ run : python -m pip install dist/*.whl
54+
55+ - name : Run CLI (if present)
56+ if : ${{ inputs.cli_test_cmd != '' }}
57+ run : ${{ inputs.cli_test_cmd }}
You can’t perform that action at this time.
0 commit comments