Skip to content

Commit 25003a9

Browse files
committed
ci: add test job to workflow and expand trigger conditions (@monperrus at work)
1 parent 438ce0c commit 25003a9

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

.github/workflows/pypi-publish.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
1-
name: Upload Package to PyPI
2-
# authorization handled via trusted publishers, see https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/
1+
name: Check and Publish
2+
33
on:
44
push:
55
branches:
66
- main
7+
pull_request:
8+
branches:
9+
- main
710

811
permissions:
912
contents: read
1013

1114
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
19+
- name: Set up Python
20+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
21+
with:
22+
python-version: '3.x'
23+
- run: pip install .
24+
- run: pip install pytest
25+
- run: pytest -v
26+
1227
deploy:
28+
needs: test
29+
if: github.event_name != 'pull_request'
1330
runs-on: ubuntu-latest
1431
permissions:
1532
id-token: write

0 commit comments

Comments
 (0)