|
18 | 18 | FORCE_COLOR: "1" |
19 | 19 |
|
20 | 20 | jobs: |
21 | | - build: |
| 21 | + get-environments: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + outputs: |
| 24 | + envs: ${{ steps.get-envs.outputs.envs }} |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v5 |
| 27 | + with: { filter: "blob:none", fetch-depth: 0 } |
| 28 | + - uses: astral-sh/setup-uv@v7 |
| 29 | + with: { enable-cache: false } |
| 30 | + - id: get-envs |
| 31 | + run: | |
| 32 | + ENVS_JSON=$(NO_COLOR=1 uvx hatch env show --json | jq -c 'to_entries |
| 33 | + | map( |
| 34 | + select(.key | startswith("hatch-test")) |
| 35 | + | { name: .key, python: .value.python } |
| 36 | + )') |
| 37 | + echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT |
| 38 | +
|
| 39 | + test: |
| 40 | + needs: get-environments |
22 | 41 | runs-on: ubuntu-latest |
23 | 42 | strategy: |
24 | 43 | matrix: |
25 | | - python-version: ["3.10", "3.11", "3.12"] |
| 44 | + env: ${{ fromJSON(needs.get-environments.outputs.envs) }} |
26 | 45 | steps: |
27 | | - - uses: actions/checkout@v4 |
28 | | - with: |
29 | | - fetch-depth: 0 |
30 | | - filter: blob:none |
31 | | - - uses: actions/setup-python@v5 |
32 | | - with: |
33 | | - python-version: ${{ matrix.python-version }} |
34 | | - - uses: hynek/setup-cached-uv@v2 |
| 46 | + - uses: actions/checkout@v5 |
| 47 | + with: { fetch-depth: 0, filter: "blob:none" } |
| 48 | + - uses: actions/setup-python@v6 |
35 | 49 | with: |
36 | | - cache-dependency-path: pyproject.toml |
| 50 | + python-version: ${{ matrix.env.python-version }} |
| 51 | + - uses: astral-sh/setup-uv@v7 |
37 | 52 | - name: dependencies |
38 | 53 | # TODO: remove typer constraint after fixing https://github.com/WaylonWalker/coverage-rich/issues/4 |
39 | 54 | run: uv pip install --system .[test,typehints,myst] coverage-rich 'typer <0.14' 'anyconfig[toml] >=0.14' |
|
46 | 61 | with: |
47 | 62 | fail_ci_if_error: true |
48 | 63 | token: c66a2830-d3c7-4ae7-a230-21aef89dcf65 |
| 64 | + |
| 65 | + check: |
| 66 | + if: always() |
| 67 | + needs: |
| 68 | + - get-environments |
| 69 | + - test |
| 70 | + runs-on: ubuntu-latest |
| 71 | + steps: |
| 72 | + - uses: re-actors/alls-green@release/v1 |
| 73 | + with: |
| 74 | + jobs: ${{ toJSON(needs) }} |
0 commit comments