Skip to content

Commit

Permalink
ci: Move test-matrix into a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Nov 7, 2024
1 parent 366d932 commit d8e2d2a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 25 deletions.
14 changes: 14 additions & 0 deletions .github/test-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"default": {
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
"environment": ["test-39", "test-312"]
},
"full": {
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
"environment": ["test-39", "test-310", "test-311", "test-312"]
},
"downstream": {
"os": ["ubuntu-latest"],
"environment": ["test-311"]
}
}
27 changes: 2 additions & 25 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- 'pixi.toml'
- 'pyproject.toml'
- '.github/workflows/test.yaml'
- name: Set matrix option
- name: Set matrix
run: |
if [[ '${{ github.event_name }}' == 'workflow_dispatch' ]]; then
OPTION=${{ github.event.inputs.target }}
Expand All @@ -77,30 +77,7 @@ jobs:
else
OPTION="default"
fi
echo "MATRIX_OPTION=$OPTION" >> $GITHUB_ENV
- name: Set test matrix with 'default' option
if: env.MATRIX_OPTION == 'default'
run: |
MATRIX=$(jq -nsc '{
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
"environment": ["test-39", "test-312"]
}')
echo "MATRIX=$MATRIX" >> $GITHUB_ENV
- name: Set test matrix with 'full' option
if: env.MATRIX_OPTION == 'full'
run: |
MATRIX=$(jq -nsc '{
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
"environment": ["test-39", "test-310", "test-311", "test-312"]
}')
echo "MATRIX=$MATRIX" >> $GITHUB_ENV
- name: Set test matrix with 'downstream' option
if: env.MATRIX_OPTION == 'downstream'
run: |
MATRIX=$(jq -nsc '{
"os": ["ubuntu-latest"],
"environment": ["test-311"]
}')
MATRIX=$(jq -c ".$OPTION" "${GITHUB_WORKSPACE}/.github/test-matrix.json")
echo "MATRIX=$MATRIX" >> $GITHUB_ENV
pixi_lock:
Expand Down

0 comments on commit d8e2d2a

Please sign in to comment.