|
10 | 10 | JUPYTER_PLATFORM_DIRS: '1' |
11 | 11 |
|
12 | 12 | jobs: |
| 13 | + get-environments: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + outputs: |
| 16 | + envs: ${{ steps.get-envs.outputs.envs }} |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v6 |
| 19 | + with: { filter: blob:none, fetch-depth: 0 } |
| 20 | + - uses: astral-sh/setup-uv@v7 |
| 21 | + with: { enable-cache: false } |
| 22 | + - id: get-envs |
| 23 | + run: | |
| 24 | + ENVS_JSON=$(NO_COLOR=1 uvx hatch env show --json | jq -c 'to_entries |
| 25 | + | map( |
| 26 | + select(.key | startswith("hatch-test")) |
| 27 | + | { name: .key, python: .value.python } |
| 28 | + )') |
| 29 | + echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT |
| 30 | +
|
13 | 31 | test: |
| 32 | + needs: [get-environments] |
14 | 33 | runs-on: ubuntu-latest |
15 | 34 | strategy: |
16 | 35 | matrix: |
17 | | - include: |
18 | | - - python-version: '3.10' |
19 | | - - python-version: '3.13' |
20 | | - - python-version: '3.13' |
21 | | - extras: min |
| 36 | + env: ${{ fromJSON(needs.get-environments.outputs.envs) }} |
22 | 37 | steps: |
23 | | - - uses: actions/checkout@v5 |
| 38 | + - uses: actions/checkout@v6 |
| 39 | + with: { filter: blob:none, fetch-depth: 0 } |
| 40 | + - uses: actions/setup-python@v6 |
24 | 41 | with: |
25 | | - fetch-depth: 0 |
26 | | - filter: blob:none |
27 | | - - uses: actions/setup-python@v5 |
28 | | - with: |
29 | | - python-version: ${{ matrix.python-version }} |
30 | | - - uses: astral-sh/setup-uv@v6 |
31 | | - with: |
32 | | - enable-cache: true |
33 | | - - run: uv pip install --system -e .[${{ matrix.extras == 'min' && 'test' || 'test,jupyter' }}] |
| 42 | + python-version: ${{ matrix.env.python-version }} |
| 43 | + - uses: astral-sh/setup-uv@v7 |
| 44 | + with: { enable-cache: true } |
| 45 | + - run: uvx hatch env create ${{ matrix.env.name }} |
34 | 46 | - uses: pavelzw/pytest-action@v2 |
35 | 47 | with: |
36 | | - custom-arguments: --color=yes |
| 48 | + custom-pytest: uvx hatch run ${{ matrix.env.name }}:run --color=yes |
37 | 49 | click-to-expand: false |
38 | 50 | verbose: true |
39 | 51 | job-summary: true |
40 | 52 | emoji: false |
41 | 53 | check: |
42 | 54 | if: always() |
43 | | - needs: |
44 | | - - test |
| 55 | + needs: [test] |
45 | 56 | runs-on: ubuntu-latest |
46 | 57 | steps: |
47 | | - - uses: re-actors/alls-green@release/v1 |
48 | | - with: |
49 | | - jobs: ${{ toJSON(needs) }} |
| 58 | + - uses: re-actors/alls-green@release/v1 |
| 59 | + with: |
| 60 | + jobs: ${{ toJSON(needs) }} |
0 commit comments