|
1 | 1 | name: Check Python package code |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request_target: |
| 4 | + pull_request: |
5 | 5 | paths: |
6 | 6 | - 'packages/**' |
7 | 7 | - 'pyproject.toml' |
|
13 | 13 | - 'pyproject.toml' |
14 | 14 | - 'uv.lock' |
15 | 15 |
|
| 16 | +permissions: |
| 17 | + contents: read |
| 18 | + |
| 19 | +concurrency: |
| 20 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 21 | + cancel-in-progress: true |
| 22 | + |
16 | 23 | jobs: |
17 | 24 | check: |
| 25 | + name: Check (${{ matrix.resolution }}, py${{ matrix.python }}) |
18 | 26 | runs-on: ubuntu-latest |
19 | | - if: github.event.pull_request.head.repo.full_name == github.repository |
| 27 | + |
| 28 | + strategy: |
| 29 | + fail-fast: false |
| 30 | + matrix: |
| 31 | + # Default resolution exercises the committed lock against every |
| 32 | + # supported Python minor version. The lowest-direct cell pins each |
| 33 | + # direct dependency to its declared floor (see UV_RESOLUTION below) |
| 34 | + # and runs only on the Python floor. |
| 35 | + python: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
| 36 | + resolution: [default] |
| 37 | + include: |
| 38 | + - python: "3.10" |
| 39 | + resolution: lowest-direct |
| 40 | + |
| 41 | + permissions: |
| 42 | + contents: read |
20 | 43 |
|
21 | 44 | steps: |
22 | | - - uses: actions/checkout@v4 |
| 45 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
23 | 46 | with: |
24 | | - ref: ${{ github.event.pull_request.head.sha }} |
| 47 | + persist-credentials: false |
25 | 48 |
|
26 | 49 | - name: Install uv |
27 | | - uses: astral-sh/setup-uv@v4 |
| 50 | + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 |
28 | 51 | with: |
29 | 52 | version: "latest" |
30 | 53 |
|
31 | 54 | - name: Set up Python |
32 | | - uses: actions/setup-python@v5 |
| 55 | + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
33 | 56 | with: |
34 | | - python-version: "3.10" |
| 57 | + python-version: ${{ matrix.python }} |
| 58 | + |
| 59 | + # UV_RESOLUTION=lowest-direct makes `uv sync` re-resolve every direct |
| 60 | + # dependency to the lowest version permitted by pyproject.toml. This |
| 61 | + # exercises the declared floor (e.g. pydantic==2.12.0) instead of |
| 62 | + # whatever the committed lock happens to point at. Failures here mean |
| 63 | + # a direct dep's minimum needs to be bumped. Set via GITHUB_ENV only |
| 64 | + # in the relevant cell so default cells run with no UV_RESOLUTION at |
| 65 | + # all -- otherwise an empty value is rejected by uv. |
| 66 | + - name: Configure resolution |
| 67 | + if: matrix.resolution == 'lowest-direct' |
| 68 | + run: echo "UV_RESOLUTION=lowest-direct" >> "$GITHUB_ENV" |
35 | 69 |
|
36 | 70 | - name: Run make check |
37 | 71 | run: make check |
0 commit comments