mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 11:06:56 +08:00
Parameters: add option 'system_list'; UnitTesting now requires field 'system' in the matrix
This commit is contained in:
31
.github/workflows/Parameters.yml
vendored
31
.github/workflows/Parameters.yml
vendored
@@ -35,6 +35,11 @@ on:
|
||||
required: false
|
||||
default: '3.7 3.8 3.9 3.10'
|
||||
type: string
|
||||
system_list:
|
||||
description: 'Space separated list of systems to run tests on.'
|
||||
required: false
|
||||
default: 'ubuntu windows macos'
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the tool.'
|
||||
required: true
|
||||
@@ -75,18 +80,32 @@ jobs:
|
||||
print("Parameters:")
|
||||
print(params)
|
||||
|
||||
systems = '${{ inputs.system_list }}'.split(' ')
|
||||
versions = '${{ inputs.python_version_list }}'.split(' ')
|
||||
if '3.6' in versions:
|
||||
print('WARNING: support for Python 3.6 ended in 2021.12.23')
|
||||
data = {
|
||||
'3.6': { 'icon': '⚫', 'until': '2021.12.23' },
|
||||
'3.7': { 'icon': '🔴', 'until': '2023.06.27' },
|
||||
'3.8': { 'icon': '🟠', 'until': '2024.10' },
|
||||
'3.9': { 'icon': '🟡', 'until': '2025.10' },
|
||||
'3.10': { 'icon': '🟢', 'until': '2026.10' },
|
||||
'python': {
|
||||
'3.6': { 'icon': '⚫', 'until': '2021.12.23' },
|
||||
'3.7': { 'icon': '🔴', 'until': '2023.06.27' },
|
||||
'3.8': { 'icon': '🟠', 'until': '2024.10' },
|
||||
'3.9': { 'icon': '🟡', 'until': '2025.10' },
|
||||
'3.10': { 'icon': '🟢', 'until': '2026.10' },
|
||||
},
|
||||
'sys': {
|
||||
'ubuntu': '🐧',
|
||||
'windows': '🧊',
|
||||
'macos': '🍎',
|
||||
}
|
||||
}
|
||||
jobs = [
|
||||
{'python': version, 'icon': data[version]['icon']}
|
||||
{
|
||||
'sysicon': data['sys'][system],
|
||||
'system': system,
|
||||
'pyicon': data['python'][version]['icon'],
|
||||
'python': version
|
||||
}
|
||||
for system in systems
|
||||
for version in versions
|
||||
]
|
||||
print(f'::set-output name=python_jobs::{jobs!s}')
|
||||
|
||||
7
.github/workflows/UnitTesting.yml
vendored
7
.github/workflows/UnitTesting.yml
vendored
@@ -48,8 +48,8 @@ on:
|
||||
jobs:
|
||||
|
||||
UnitTesting:
|
||||
name: ${{ matrix.icon }} Unit Tests using Python ${{ matrix.python }}
|
||||
runs-on: ubuntu-latest
|
||||
name: ${{ matrix.sysicon }} ${{ matrix.pyicon }} Unit Tests using Python ${{ matrix.python }}
|
||||
runs-on: ${{ matrix.system }}-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -71,6 +71,7 @@ jobs:
|
||||
python -m pip install ${{ inputs.requirements }}
|
||||
|
||||
- name: ☑ Run unit tests
|
||||
shell: bash
|
||||
run: |
|
||||
[ 'x${{ inputs.artifact }}' != 'x' ] && PYTEST_ARGS='--junitxml=TestReport.xml' || unset PYTEST_ARGS
|
||||
python -m pytest -rA ${{ inputs.unittest_directory }} $PYTEST_ARGS --color=yes
|
||||
@@ -79,7 +80,7 @@ jobs:
|
||||
if: inputs.artifact != ''
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ inputs.artifact }}-${{ matrix.python }}
|
||||
name: ${{ inputs.artifact }}-${{ matrix.system }}-${{ matrix.python }}
|
||||
path: TestReport.xml
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
Reference in New Issue
Block a user