Skip to content

Commit 5ba045c

Browse files
committed
ci(smoke): robust post-release smoke test
1 parent 9fc1538 commit 5ba045c

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: post-release-smoke
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
smoke:
12+
name: Post-release smoke on PyPI
13+
runs-on: ubuntu-latest
14+
env:
15+
PKG: ci-matrix-starter
16+
TAG_NAME: ${{ github.event.release.tag_name }}
17+
18+
steps:
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.12"
22+
cache: "pip"
23+
24+
- name: Wait until version is visible on PyPI
25+
run: |
26+
TAG="${TAG_NAME#v}"
27+
count=0
28+
while [ "$count" -lt 30 ]; do
29+
ver="$(curl -fsSL "https://pypi.org/pypi/${PKG}/json" 2>/dev/null \
30+
| python -c 'import sys,json; d=json.load(sys.stdin); print((d.get("info") or {}).get("version") or "")')"
31+
if [ "$ver" = "$TAG" ]; then
32+
printf "✅ PyPI has %s==%s\n" "$PKG" "$ver"
33+
break
34+
fi
35+
printf "⏳ Waiting PyPI index to show %s==%s (got: %s)\n" "$PKG" "$TAG" "$ver"
36+
sleep 10
37+
count=$((count+1))
38+
done
39+
test "$ver" = "$TAG"
40+
41+
- name: Install from PyPI
42+
run: |
43+
python -m pip install --upgrade pip
44+
pip install "$PKG==${TAG_NAME#v}"
45+
46+
- name: Import check
47+
run: |
48+
python -c 'import importlib; m=importlib.import_module("ci_matrix_starter"); print("✅ import ok:", m.__name__)'

0 commit comments

Comments
 (0)