Skip to content

Commit 77ed5bb

Browse files
committed
Check job matrix.
1 parent 6432741 commit 77ed5bb

6 files changed

Lines changed: 37 additions & 25 deletions

File tree

.github/actions/CheckArtifactNames/action.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ runs:
2525
- name: Check artifact names
2626
id: check
2727
shell: python
28-
working-directory: ${{ inputs.path }}
2928
run: |
3029
from pyTooling.Common import zipdicts
3130
32-
expectedName = "Example"
31+
actualArtifactNames = json_loads("""${{ inputs.generated-names }}""".replace("'", '"'))
32+
33+
expectedName = "${{ inputs.prefix }}"
3334
expectedArtifacts = {
3435
"unittesting_xml": f"{expectedName}-UnitTestReportSummary-XML",
3536
"unittesting_html": f"{expectedName}-UnitTestReportSummary-HTML",
@@ -49,9 +50,7 @@ runs:
4950
"documentation_pdf": f"{expectedName}-Documentation-PDF",
5051
}
5152
52-
actualArtifactNames = json_loads("""${{ inputs }}""".replace("'", '"'))
5353
errors = 0
54-
5554
if len(actualArtifactNames) != len(expectedArtifacts):
5655
print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.")
5756
errors += 1

.github/actions/CheckJobMatrix/action.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,23 @@ runs:
4545
from json import loads as json_loads
4646
from sys import exit
4747
48-
expectedPythonVersion = """${{ inputs.expected-default-version }}"""
49-
expectedPythons = json_loads("""${{ inputs.expected-python-versions }}""".replace("'", '"'))
50-
expectedSystems = json_loads("""${{ inputs.expected-systems }}""".replace("'", '"'))
51-
excludedJobs = json_loads("""${{ inputs.expected-exclude-jobs }}""".replace("'", '"'))
52-
includeJobs = json_loads("""${{ inputs.expected-include-jobs }}""".replace("'", '"'))
53-
expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons if f"{system}:{python}" not in excludedJobs] + includeJobs
54-
5548
actualPythonVersion = """${{ inputs.generated-default-version }}"""
5649
actualPythonJobs = json_loads("""${{ inputs.generated-jobmatrix }}""".replace("'", '"'))
57-
errors = 0
5850
51+
expectedPythonVersion = """${{ inputs.expected-default-version }}"""
52+
expectedPythons = json_loads("""${{ inputs.expected-python-versions }}""".replace("'", '"'))
53+
expectedSystems = json_loads("""${{ inputs.expected-systems }}""".replace("'", '"'))
54+
excludedJobs = json_loads("""${{ inputs.expected-exclude-jobs }}""".replace("'", '"'))
55+
includeJobs = json_loads("""${{ inputs.expected-include-jobs }}""".replace("'", '"'))
56+
expectedJobs = sorted([f"{system}:{python}" for system in expectedSystems for python in expectedPythons if f"{system}:{python}" not in excludedJobs] + includeJobs)
57+
58+
errors = 0
5959
if actualPythonVersion != expectedPythonVersion:
6060
print(f"'python_version' does not match: '{actualPythonVersion}' != '{expectedPythonVersion}'.")
6161
errors += 1
6262
6363
if len(actualPythonJobs) != len(expectedJobs):
64-
print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.")
64+
print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.")
6565
print("Actual jobs:")
6666
for job in actualPythonJobs:
6767
if job['system'] == "msys2":
@@ -74,9 +74,19 @@ runs:
7474
print(f" {job}")
7575
errors += 1
7676
else:
77-
print("❌ Checking job matrix is not implemented")
77+
print("✅ Number of 'python_jobs' as expected.")
78+
print("Checking job combinations ...")
7879
79-
if errors == 0:
80-
print(f"All checks PASSED.")
80+
actualJobs = sorted([f"{job['system'] if job['system'] != 'msys2' else job['runtime'].lower()}:{job['python']}" for job in actualPythonJobs])
81+
for actual, expected in zip(actualJobs, expectedJobs):
82+
if actual != expected:
83+
print(f" ❌ Job does not match: {actual} != {expected}.")
84+
errors += 1
85+
else:
86+
print(f" ☑ Job as expected: {actual}.")
8187
82-
exit(errors)
88+
if errors == 0:
89+
print("✅ All checks PASSED.")
90+
else:
91+
print(f"❌ Counted {errors} errors.")
92+
exit(errors)

.github/workflows/_Checking_JobTemplates.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ jobs:
1515
uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev
1616
with:
1717
package_name: 'myPackage'
18-
python_version_list: '3.9 3.10 3.11 3.12 3.13 3.14 pypy-3.10 pypy-3.11'
18+
python_version: '3.13' # workaround to use Sphinx in Python 3.13 for sphinx_reports not yet supporting lxml 6.0
19+
python_version_list: '3.10 3.11 3.12 3.13 3.14 pypy-3.10 pypy-3.11'
1920
disable_list: 'windows-arm:pypy-3.10 windows-arm:pypy-3.11'
2021

2122
PlatformTestingParams:

.github/workflows/_Checking_NamespacePackage_Pipeline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
with:
1111
package_namespace: 'myFramework'
1212
package_name: 'Extension'
13+
unittest_python_version: '3.13' # workaround to use Sphinx in Python 3.13 for sphinx_reports not yet supporting lxml 6.0
1314
bandit: 'true'
1415
pylint: 'true'
1516
codecov: 'true'

.github/workflows/_Checking_Parameters.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
- name: Checking job matrix from 'Params_PythonVersions'
9898
uses: ./.github/actions/CheckJobMatrix
9999
with:
100-
expected-default-version: '3.13'
100+
expected-default-version: '3.14'
101101
expected-python-versions: '["3.12", "3.13", "pypy-3.10", "pypy-3.11"]'
102102
expected-systems: '["ubuntu", "ubuntu-arm", "windows", "windows-arm", "macos", "macos-arm"]'
103103
expected-exclude-jobs: '["windows-arm:pypy-3.10", "windows-arm:pypy-3.11"]'
@@ -119,7 +119,7 @@ jobs:
119119
- name: Checking job matrix from 'Params_Systems'
120120
uses: ./.github/actions/CheckJobMatrix
121121
with:
122-
expected-default-version: '3.13'
122+
expected-default-version: '3.14'
123123
expected-python-versions: '["3.9", "3.10", "3.11", "3.12", "3.13"]'
124124
expected-systems: '["windows"]'
125125
expected-exclude-jobs: '[]'
@@ -141,7 +141,7 @@ jobs:
141141
- name: Checking job matrix from 'Params_Include'
142142
uses: ./.github/actions/CheckJobMatrix
143143
with:
144-
expected-default-version: '3.13'
144+
expected-default-version: '3.14'
145145
expected-python-versions: '["3.12"]'
146146
expected-systems: '["ubuntu", "windows", "macos", "macos-arm"]'
147147
expected-exclude-jobs: '[]'
@@ -163,7 +163,7 @@ jobs:
163163
- name: Checking job matrix from 'Params_Exclude'
164164
uses: ./.github/actions/CheckJobMatrix
165165
with:
166-
expected-default-version: '3.13'
166+
expected-default-version: '3.14'
167167
expected-python-versions: '["3.13"]'
168168
expected-systems: '["ubuntu", "macos", "macos-arm"]'
169169
expected-exclude-jobs: '[]'
@@ -185,7 +185,7 @@ jobs:
185185
- name: Checking job matrix from 'Params_Disable'
186186
uses: ./.github/actions/CheckJobMatrix
187187
with:
188-
expected-default-version: '3.13'
188+
expected-default-version: '3.14'
189189
expected-python-versions: '["3.13"]'
190190
expected-systems: '["ubuntu", "windows", "macos", "macos-arm"]'
191191
expected-exclude-jobs: '["windows:3.13"]'
@@ -203,11 +203,11 @@ jobs:
203203
steps:
204204
- name: Checkout repository to access local Action
205205
uses: actions/checkout@v5
206-
206+
207207
- name: Checking job matrix from 'Params_All'
208208
uses: ./.github/actions/CheckJobMatrix
209209
with:
210-
expected-default-version: '3.13'
210+
expected-default-version: '3.14'
211211
expected-python-versions: '["3.12", "3.13"]'
212212
expected-systems: '["ubuntu", "windows", "macos-arm"]'
213213
expected-exclude-jobs: '[]'

.github/workflows/_Checking_SimplePackage_Pipeline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
uses: pyTooling/Actions/.github/workflows/CompletePipeline.yml@dev
1010
with:
1111
package_name: 'myPackage'
12+
unittest_python_version: '3.13' # workaround to use Sphinx in Python 3.13 for sphinx_reports not yet supporting lxml 6.0
1213
bandit: 'true'
1314
pylint: 'true'
1415
codecov: 'true'

0 commit comments

Comments
 (0)