diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index 04fef85..cf7bdba 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -3,6 +3,11 @@ name: Unit Testing on: workflow_call: inputs: + python_versions: + description: 'Space separated list of Python versions to run tests with.' + required: false + default: '3.6 3.7 3.8 3.9 3.10' + type: string requirements: description: 'Python dependencies to be installed through pip.' required: false @@ -16,19 +21,40 @@ on: jobs: + + Versions: + runs-on: ubuntu-latest + outputs: + jobs: ${{ steps.versions.outputs.jobs }} + steps: + + - id: versions + shell: python + run: | + icons = { + '3.6': '🔴', # until 23.12.2021 + '3.7': '🟠', # until 27.06.2023 + '3.8': '🟡', # until Oct. 2024 + '3.9': '🟢', # until Oct. 2025 + '3.10': '🟢', # until Oct. 2026 + } + jobs = [ + {'python': version, 'icon': icons[version]} + for version in '${{ inputs.python_versions }}'.split(' ') + ] + print(f'::set-output name=jobs::{jobs!s}') + + UnitTesting: name: ${{ matrix.icon }} Unit Tests using Python ${{ matrix.python }} runs-on: ubuntu-latest + needs: + - Versions strategy: fail-fast: false matrix: - include: -# - {python: "3.6", icon: 🔴} # until 23.12.2021 - - {python: "3.7", icon: 🟠} # until 27.06.2023 - - {python: "3.8", icon: 🟡} # until Oct. 2024 - - {python: "3.9", icon: 🟢} # until Oct. 2025 - - {python: "3.10", icon: 🟢} # until Oct. 2026 + include: ${{ fromJson(needs.Versions.outputs.jobs) }} steps: - name: ⏬ Checkout repository