Skip to content

Commit 83c4e4e

Browse files
authored
Merge pull request #423 from carpentries-incubator/python-ci-clarity
Expand Python version range for build matrix and where the version variable is used
2 parents 11ae11f + 45f45a5 commit 83c4e4e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

episodes/23-continuous-integration-automated-testing.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ we can use a feature called **build matrices**
332332
which really shows the value of using CI to test at scale.
333333

334334
Suppose the intended users of our software use either Ubuntu, Mac OS, or Windows,
335-
and either have Python version 3.10 or 3.11 installed,
335+
and have Python versions 3.10 through 3.12 installed,
336336
and we want to support all of these.
337337
Assuming we have a suitable test suite,
338338
it would take a considerable amount of time to set up testing platforms
@@ -363,7 +363,7 @@ jobs:
363363
strategy:
364364
matrix:
365365
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
366-
python-version: ["3.10", "3.11"]
366+
python-version: ["3.10", "3.11", "3.12"]
367367
368368
# Here we add the reference to the os matrix values
369369
runs-on: ${{ matrix.os }}
@@ -374,7 +374,7 @@ jobs:
374374
- name: Checkout repository
375375
uses: actions/checkout@v4
376376
377-
- name: Set up Python
377+
- name: Set up Python ${{ matrix.python-version }}
378378
uses: actions/setup-python@v5
379379
with:
380380
# Here we add the reference to the python-version matrix values
@@ -391,9 +391,12 @@ jobs:
391391

392392
The `{{ }}` are used
393393
as a means to reference configuration values from the matrix.
394-
This way, every possible permutation of Python versions 3.10 and 3.11
394+
This way, every possible permutation of Python versions 3.10 through 3.12
395395
with the latest versions of Ubuntu, Mac OS and Windows operating systems
396-
will be tested and we can expect 6 build jobs in total.
396+
will be tested, and we can expect 9 build jobs in total.
397+
We can also use this in the `name` key of the step to accurately reflect what it is doing
398+
(e.g. which Python version is being setup).
399+
This will be reflected in the GitHub Action output, making parsing those logs easier.
397400

398401
Let us commit and push this change and see what happens:
399402

0 commit comments

Comments
 (0)