Skip to content

Commit

Permalink
ci: configure pr's matrix from hatch env json file
Browse files Browse the repository at this point in the history
  • Loading branch information
ketozhang committed Nov 20, 2024
1 parent 14c8eb0 commit 3ff0373
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/hatch-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"include": [
{
"hatch-env-name": "test.py3.10-numpy-version=1",
"python-version": "3.10"
},
{
"hatch-env-name": "test.py3.10-numpy-version=2",
"python-version": "3.10"
},
{
"hatch-env-name": "test.py3.11-numpy-version=1",
"python-version": "3.11"
},
{
"hatch-env-name": "test.py3.11-numpy-version=2",
"python-version": "3.11"
},
{
"hatch-env-name": "test.py3.12-numpy-version=1",
"python-version": "3.12"
},
{
"hatch-env-name": "test.py3.12-numpy-version=2",
"python-version": "3.12"
},
{
"hatch-env-name": "test.py3.13-numpy-version=1",
"python-version": "3.13"
},
{
"hatch-env-name": "test.py3.13-numpy-version=2",
"python-version": "3.13"
}
]
}
8 changes: 8 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ on:
branches: ["main", "v1"]

jobs:
prepare-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Set matrix
id: set-matrix
run: echo "matrix=$(cat .github/workflows/hatch-matrix.json | jq -c )" >> $GITHUB_OUTPUT
test:
runs-on: ubuntu-latest
strategy:
Expand Down

0 comments on commit 3ff0373

Please sign in to comment.