mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
Parameters: support system 'msys2' (MINGW64); update UnitTesting accordingly
This commit is contained in:
15
.github/workflows/Parameters.yml
vendored
15
.github/workflows/Parameters.yml
vendored
@@ -38,7 +38,7 @@ on:
|
|||||||
system_list:
|
system_list:
|
||||||
description: 'Space separated list of systems to run tests on.'
|
description: 'Space separated list of systems to run tests on.'
|
||||||
required: false
|
required: false
|
||||||
default: 'ubuntu windows macos'
|
default: 'ubuntu windows msys2 macos'
|
||||||
type: string
|
type: string
|
||||||
name:
|
name:
|
||||||
description: 'Name of the tool.'
|
description: 'Name of the tool.'
|
||||||
@@ -93,20 +93,23 @@ jobs:
|
|||||||
'3.10': { 'icon': '🟢', 'until': '2026.10' },
|
'3.10': { 'icon': '🟢', 'until': '2026.10' },
|
||||||
},
|
},
|
||||||
'sys': {
|
'sys': {
|
||||||
'ubuntu': '🐧',
|
'ubuntu': { 'icon': '🐧', 'runs-on': 'ubuntu-latest', 'shell': 'bash' },
|
||||||
'windows': '🧊',
|
'windows': { 'icon': '🧊', 'runs-on': 'windows-latest', 'shell': 'pwsh' },
|
||||||
'macos': '🍎',
|
'msys2': { 'icon': '🟦', 'runs-on': 'windows-latest', 'shell': 'msys2 {0}' },
|
||||||
|
'macos': { 'icon': '🍎', 'runs-on': 'macos-latest', 'shell': 'bash' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
jobs = [
|
jobs = [
|
||||||
{
|
{
|
||||||
'sysicon': data['sys'][system],
|
'sysicon': data['sys'][system]['icon'],
|
||||||
'system': system,
|
'system': system,
|
||||||
|
'runs-on': data['sys'][system]['runs-on'],
|
||||||
|
'shell': data['sys'][system]['shell'],
|
||||||
'pyicon': data['python'][version]['icon'],
|
'pyicon': data['python'][version]['icon'],
|
||||||
'python': version
|
'python': version
|
||||||
}
|
}
|
||||||
for system in systems
|
for system in systems
|
||||||
for version in versions
|
for version in (versions if system != 'msys2' else ['3.9'])
|
||||||
]
|
]
|
||||||
print(f'::set-output name=python_jobs::{jobs!s}')
|
print(f'::set-output name=python_jobs::{jobs!s}')
|
||||||
print("Python jobs:")
|
print("Python jobs:")
|
||||||
|
|||||||
18
.github/workflows/UnitTesting.yml
vendored
18
.github/workflows/UnitTesting.yml
vendored
@@ -49,18 +49,31 @@ jobs:
|
|||||||
|
|
||||||
UnitTesting:
|
UnitTesting:
|
||||||
name: ${{ matrix.sysicon }} ${{ matrix.pyicon }} Unit Tests using Python ${{ matrix.python }}
|
name: ${{ matrix.sysicon }} ${{ matrix.pyicon }} Unit Tests using Python ${{ matrix.python }}
|
||||||
runs-on: ${{ matrix.system }}-latest
|
runs-on: ${{ matrix.runs-on }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include: ${{ fromJson(inputs.jobs) }}
|
include: ${{ fromJson(inputs.jobs) }}
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: ${{ matrix.shell }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: ⏬ Checkout repository
|
- name: ⏬ Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: 🐍 Setup Python ${{ matrix.python }}
|
- if: matrix.system == 'msys2'
|
||||||
|
name: '🟦 Setup MSYS2'
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
msystem: MINGW64
|
||||||
|
update: true
|
||||||
|
pacboy: python-pip:p
|
||||||
|
|
||||||
|
- if: matrix.system != 'msys2'
|
||||||
|
name: 🐍 Setup Python ${{ matrix.python }}
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
@@ -71,7 +84,6 @@ 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
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: ToolName
|
name: ToolName
|
||||||
# Optional
|
# Optional
|
||||||
system_list: 'ubuntu windows macos'
|
system_list: 'ubuntu windows msys2 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