Skip to content

Commit 600ea86

Browse files
author
TangLongbin
committed
Add testing step to Python package publish workflow
1 parent e292fca commit 600ea86

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

.github/workflows/python-publish.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828

2929
- name: Build release distributions
3030
run: |
31-
# NOTE: put your own distribution build steps here.
3231
python -m pip install build
3332
python -m build
3433
@@ -38,10 +37,27 @@ jobs:
3837
name: release-dists
3938
path: dist/
4039

40+
test:
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- uses: actions/setup-python@v5·
47+
with:
48+
python-version: "3.10.12"
49+
50+
- name: Test with pytest
51+
run: |
52+
pip install pytest
53+
pip install -e .
54+
pytest
55+
4156
pypi-publish:
4257
runs-on: ubuntu-latest
4358
needs:
4459
- release-build
60+
- test
4561
permissions:
4662
# IMPORTANT: this permission is mandatory for trusted publishing
4763
id-token: write
@@ -50,8 +66,7 @@ jobs:
5066
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
5167
environment:
5268
name: pypi
53-
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54-
# url: https://pypi.org/p/YOURPROJECT
69+
url: https://pypi.org/project/torchcontrol/
5570
#
5671
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
5772
# ALTERNATIVE: exactly, uncomment the following line instead:

0 commit comments

Comments
 (0)