Skip to content

Commit 1dd94a4

Browse files
committed
ci
1 parent 84d731b commit 1dd94a4

File tree

2 files changed

+40
-12
lines changed

2 files changed

+40
-12
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,37 @@ env:
1818
FORCE_COLOR: "1"
1919

2020
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
2241
runs-on: ubuntu-latest
2342
strategy:
2443
matrix:
25-
python-version: ["3.10", "3.11", "3.12"]
44+
env: ${{ fromJSON(needs.get-environments.outputs.envs) }}
2645
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
3549
with:
36-
cache-dependency-path: pyproject.toml
50+
python-version: ${{ matrix.env.python-version }}
51+
- uses: astral-sh/setup-uv@v7
3752
- name: dependencies
3853
# TODO: remove typer constraint after fixing https://github.com/WaylonWalker/coverage-rich/issues/4
3954
run: uv pip install --system .[test,typehints,myst] coverage-rich 'typer <0.14' 'anyconfig[toml] >=0.14'
@@ -46,3 +61,14 @@ jobs:
4661
with:
4762
fail_ci_if_error: true
4863
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) }}

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,16 @@ version-file = 'src/scanpydoc/_version.py'
9494
[tool.hatch.envs.default]
9595
dependencies = ['types-docutils']
9696
[tool.hatch.envs.docs]
97-
python = '3.11'
97+
python = '3.13'
9898
features = ['doc']
9999
[tool.hatch.envs.docs.scripts]
100100
build = 'sphinx-build -M html docs docs/_build'
101101
clean = 'git clean -fdX docs'
102102

103103
[tool.hatch.envs.hatch-test]
104104
features = ['test', 'typehints', 'myst']
105+
[[tool.hatch.envs.hatch-test.matrix]]
106+
python = ['3.12', '3.14']
105107

106108
[tool.pytest.ini_options]
107109
addopts = [

0 commit comments

Comments
 (0)