I run two different kinds of jobs at once and show that the wall-clock time equals the slowest one, then expand the matrix with an extra axis to four jobs.
print("Two parallel jobs: test + lint")
print("Wall-clock time = max(test 40s, lint 30s) = 40s")
oses = ["ubuntu-latest", "windows-latest"]
py_versions = ["3.10", "3.11"]
rows = [(o, v) for o in oses for v in py_versions]
print()
print("Matrix with extra axis: os x python-version")
print("Total jobs: %d" % len(rows))
for o, v in rows:
print("Job: %s on python-%s -> PASS" % (o, v))
Before you run it, say out loud what it will print. Then open the answer.
What it prints
Two parallel jobs: test + lint
Wall-clock time = max(test 40s, lint 30s) = 40s
Matrix with extra axis: os x python-version
Total jobs: 4
Job: ubuntu-latest on python-3.10 -> PASS
Job: ubuntu-latest on python-3.11 -> PASS
Job: windows-latest on python-3.10 -> PASS
Job: windows-latest on python-3.11 -> PASS
Adding an axis multiplies the job count, not just the coverage. A 2x2 matrix is four jobs; a 3x3 matrix is nine. Keep the matrix small enough to stay cheap and fast.