Skip to content

Commit f22a4b3

Browse files
committed
I think I got it!
1 parent 1a7d4c7 commit f22a4b3

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

  • {{cookiecutter.project_name}}/.github/workflows

{{cookiecutter.project_name}}/.github/workflows/test.yaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
get-environments:
2222
runs-on: ubuntu-latest
2323
outputs:
24-
matrix: ${{ steps.get-envs.outputs.matrix }}
24+
envs: ${{ steps.get-envs.outputs.envs }}
2525
steps:
2626
- uses: actions/checkout@v4
2727
with:
@@ -36,23 +36,24 @@ jobs:
3636
| map(
3737
select(.key | startswith("hatch-test"))
3838
| {
39-
env_name: .key,
40-
name: (if (.key | contains("pre")) then .key + " (PRE-RELEASE DEPENDENCIES)" else .key end),
39+
name: .key,
40+
label: (if (.key | contains("pre")) then .key + " (PRE-RELEASE DEPENDENCIES)" else .key end),
4141
python: .value.python
4242
}
4343
)')
44-
echo "matrix=${MATRIX_JSON}" | tee $GITHUB_OUTPUT
44+
echo "envs=${MATRIX_JSON}" | tee $GITHUB_OUTPUT
4545
4646
test:
4747
needs: get-environments
48-
runs-on: ubuntu-latest
48+
runs-on: ${{ matrix.os }}
4949

5050
strategy:
5151
fail-fast: false
5252
matrix:
53-
include: ${{ fromJSON(needs.get-environments.outputs.matrix) }}
53+
os: [ubuntu-latest]
54+
env: ${{ fromJSON(needs.get-environments.outputs.envs) }}
5455

55-
name: ${{ matrix.name }}
56+
name: ${{ matrix.env.label }}
5657

5758
steps:
5859
- uses: actions/checkout@v4
@@ -62,17 +63,17 @@ jobs:
6263
- name: Install uv
6364
uses: astral-sh/setup-uv@v5
6465
with:
65-
python-version: ${{ matrix.python }}
66+
python-version: ${{ matrix.env.python }}
6667
cache-dependency-glob: pyproject.toml
6768
- name: create hatch environment
68-
run: uvx hatch env create ${{ matrix.env_name }}
69+
run: uvx hatch env create ${{ matrix.env.name }}
6970
- name: run tests using hatch
7071
env:
7172
MPLBACKEND: agg
72-
PLATFORM: ubuntu-latest
73+
PLATFORM: ${{ matrix.os }}
7374
DISPLAY: :42
74-
run: uvx hatch run ${{ matrix.env_name }}:run-cov
75+
run: uvx hatch run ${{ matrix.env.name }}:run-cov
7576
- name: generate coverage report
76-
run: uvx hatch run ${{ matrix.env_name }}:coverage xml
77+
run: uvx hatch run ${{ matrix.env.name }}:coverage xml
7778
- name: Upload coverage
7879
uses: codecov/codecov-action@v4

0 commit comments

Comments
 (0)