Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ jobs:
outputs:
python-versions: ${{ steps.set-versions.outputs.python-versions }}
matplotlib-versions: ${{ steps.set-versions.outputs.matplotlib-versions }}
test-matrix: ${{ steps.set-versions.outputs.test-matrix }}
steps:
- uses: actions/checkout@v6
with:
Expand Down Expand Up @@ -187,9 +188,28 @@ jobs:
mpl_versions = ["3.9"]

# Create output dictionary
midpoint_python = python_versions[len(python_versions) // 2]
midpoint_mpl = mpl_versions[len(mpl_versions) // 2]
matrix_candidates = [
(python_versions[0], mpl_versions[0]), # lowest + lowest
(midpoint_python, midpoint_mpl), # midpoint + midpoint
(python_versions[-1], mpl_versions[-1]) # latest + latest
]
test_matrix = []
seen = set()
for py_ver, mpl_ver in matrix_candidates:
key = (py_ver, mpl_ver)
if key in seen:
continue
seen.add(key)
test_matrix.append(
{"python-version": py_ver, "matplotlib-version": mpl_ver}
)

output = {
"python_versions": python_versions,
"matplotlib_versions": mpl_versions
"matplotlib_versions": mpl_versions,
"test_matrix": test_matrix,
}

# Print as JSON
Expand All @@ -203,8 +223,10 @@ jobs:

echo "Detected Python versions: ${PYTHON_VERSIONS}"
echo "Detected Matplotlib versions: ${MPL_VERSIONS}"
echo "Detected test matrix: $(echo $OUTPUT | jq -c '.test_matrix')"
echo "python-versions=$(echo $PYTHON_VERSIONS | jq -c)" >> $GITHUB_OUTPUT
echo "matplotlib-versions=$(echo $MPL_VERSIONS | jq -c)" >> $GITHUB_OUTPUT
echo "test-matrix=$(echo $OUTPUT | jq -c '.test_matrix')" >> $GITHUB_OUTPUT

build:
needs:
Expand All @@ -214,8 +236,7 @@ jobs:
if: always() && needs.run-if-changes.outputs.run == 'true' && needs.get-versions.result == 'success' && needs.select-tests.result == 'success'
strategy:
matrix:
python-version: ${{ fromJson(needs.get-versions.outputs.python-versions) }}
matplotlib-version: ${{ fromJson(needs.get-versions.outputs.matplotlib-versions) }}
include: ${{ fromJson(needs.get-versions.outputs.test-matrix) }}
fail-fast: false
max-parallel: 4
uses: ./.github/workflows/build-ultraplot.yml
Expand Down