mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-02-08 02:27:26 +00:00
Add resolution-strategy input to support oldest compatible version selection
Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
This commit is contained in:
parent
05d3e5046d
commit
e421cf46a9
1 changed files with 43 additions and 0 deletions
43
RESOLUTION_STRATEGY_DEMO.md
Normal file
43
RESOLUTION_STRATEGY_DEMO.md
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# Resolution Strategy Demo
|
||||
|
||||
This file demonstrates the new `resolution-strategy` input.
|
||||
|
||||
## Default behavior (highest strategy)
|
||||
```yaml
|
||||
- name: Install highest compatible uv version
|
||||
uses: astral-sh/setup-uv@v6
|
||||
with:
|
||||
version: ">=0.4.0"
|
||||
# resolution-strategy: "highest" is the default
|
||||
```
|
||||
|
||||
## Lowest strategy for testing compatibility
|
||||
```yaml
|
||||
- name: Install lowest compatible uv version
|
||||
uses: astral-sh/setup-uv@v6
|
||||
with:
|
||||
version: ">=0.4.0"
|
||||
resolution-strategy: "lowest"
|
||||
```
|
||||
|
||||
## Use case: Testing with matrix of strategies
|
||||
```yaml
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
resolution-strategy: ["highest", "lowest"]
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Install uv with ${{ matrix.resolution-strategy }} strategy
|
||||
uses: astral-sh/setup-uv@v6
|
||||
with:
|
||||
version: ">=0.4.0"
|
||||
resolution-strategy: ${{ matrix.resolution-strategy }}
|
||||
cache-suffix: ${{ matrix.resolution-strategy }}
|
||||
- name: Test with strategy
|
||||
run: |
|
||||
echo "Testing with $(uv --version)"
|
||||
uv run --frozen pytest
|
||||
```
|
||||
Loading…
Reference in a new issue