Skip to content

Commit da65a52

Browse files
committed
Harden the release path further
From the configtrace review, applied everywhere since the workflows are shared. The release test job restored a uv cache and installed the package from the checkout in editable mode, so the tests never touched the distribution that actually gets uploaded. The cache is off across the whole release path now, and the built wheel is installed into a clean environment and run before it is uploaded. uv sync takes --locked in both workflows, so a pyproject.toml and uv.lock that disagree fail rather than quietly re-resolving. A release should install what was tested.
1 parent 41b723d commit da65a52

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
persist-credentials: false
4141
- uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
4242
- run: uv python install 3.15
43-
- run: uv sync --python 3.15
43+
- run: uv sync --locked --python 3.15
4444
- run: uv run --python 3.15 pytest -q tests/test_runtime.py
4545

4646
lint:
@@ -50,7 +50,7 @@ jobs:
5050
with:
5151
persist-credentials: false
5252
- uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
53-
- run: uv sync
53+
- run: uv sync --locked
5454
- run: uv run ruff check .
5555
- run: uv run ruff format --check .
5656
- run: uv run mypy
@@ -65,5 +65,5 @@ jobs:
6565
with:
6666
persist-credentials: false
6767
- uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
68-
- run: uv sync --python 3.12
68+
- run: uv sync --locked --python 3.12
6969
- run: uv run --python 3.12 importcost check

‎.github/workflows/release.yml‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ jobs:
1717
with:
1818
persist-credentials: false
1919
- uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
20-
- run: uv sync
20+
with:
21+
# No cache anywhere in the release path.
22+
enable-cache: false
23+
# --locked: fail rather than quietly re-resolve if pyproject.toml and
24+
# uv.lock disagree. A release should install what was tested.
25+
- run: uv sync --locked
2126
- run: uv run pytest -q
2227
- run: uv run ruff check .
2328
- run: uv run ruff format --check .
@@ -46,6 +51,14 @@ jobs:
4651
exit 1
4752
fi
4853
- run: uv build
54+
- name: the wheel that gets uploaded has to install and run on its own
55+
# uv sync installs from the checkout in editable mode, so the tests above
56+
# never touch the built distribution. This does.
57+
run: |
58+
uv venv /tmp/verify
59+
uv pip install --python /tmp/verify/bin/python dist/*.whl
60+
/tmp/verify/bin/importcost --version
61+
/tmp/verify/bin/python -c "import importcost; print(importcost.__version__)"
4962
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
5063
with:
5164
name: dist

0 commit comments

Comments
 (0)