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