Skip to content

Commit ca87f00

Browse files
authored
ci: add package verification check (#66)
## Summary Adds an end-to-end check that the built sdist and wheel install cleanly, ship the expected sources and data files, and that `import apify_shared` works — via the shared [apify/workflows/python-package-check](apify/workflows#296) action. Wired into every PR via `_check_package.yaml`, and into both stable and beta release workflows so the exact artifact about to hit PyPI is verified first.
1 parent 4102443 commit ca87f00

4 files changed

Lines changed: 58 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Package check
2+
3+
on:
4+
# Runs when manually triggered from the GitHub UI.
5+
workflow_dispatch:
6+
7+
# Runs when invoked by another workflow.
8+
workflow_call:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
package_check:
15+
name: Package check
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v6
20+
21+
- name: Set up uv package manager
22+
uses: astral-sh/setup-uv@v8.1.0
23+
with:
24+
python-version: "3.14"
25+
26+
- name: Build sdist and wheel
27+
run: uv run poe build
28+
29+
- name: Verify built package
30+
uses: apify/actions/python-package-check@v1.1.0
31+
with:
32+
package_name: apify_shared
33+
dist_dir: dist
34+
python_version: "3.14"
35+
smoke_code: |
36+
from apify_shared.consts import WebhookEventType

.github/workflows/manual_release_beta.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ jobs:
6060
version_number: ${{ needs.release_prepare.outputs.version_number }}
6161
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
6262

63+
- name: Verify built package
64+
uses: apify/actions/python-package-check@v1.1.0
65+
with:
66+
package_name: apify_shared
67+
dist_dir: dist
68+
python_version: "3.14"
69+
smoke_code: |
70+
from apify_shared.consts import WebhookEventType
71+
6372
# Publish the package to PyPI using PyPA official GitHub action with OIDC authentication.
6473
- name: Publish package to PyPI
6574
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/manual_release_stable.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@ jobs:
9595
version_number: ${{ needs.release_prepare.outputs.version_number }}
9696
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
9797

98+
- name: Verify built package
99+
uses: apify/actions/python-package-check@v1.1.0
100+
with:
101+
package_name: apify_shared
102+
dist_dir: dist
103+
python_version: "3.14"
104+
smoke_code: |
105+
from apify_shared.consts import WebhookEventType
106+
98107
# Publishes the package to PyPI using PyPA official GitHub action with OIDC authentication.
99108
- name: Publish package to PyPI
100109
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/on_pull_request.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ jobs:
1717
name: Code checks
1818
uses: ./.github/workflows/_check_code.yaml
1919

20+
package_check:
21+
name: Package check
22+
uses: ./.github/workflows/_check_package.yaml
23+
2024
tests:
2125
name: Tests
2226
uses: ./.github/workflows/_tests.yaml

0 commit comments

Comments
 (0)