From 26afa43fa48cc553f876931b1a6e0e8f30cfa5b6 Mon Sep 17 00:00:00 2001 From: umarcor Date: Fri, 7 Jan 2022 00:37:11 +0100 Subject: [PATCH 01/13] Parameters: remove 3.6 from default python_version_list --- .github/workflows/Parameters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 085dc13..8668a3d 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -33,7 +33,7 @@ on: python_version_list: description: 'Space separated list of Python versions to run tests with.' required: false - default: '3.6 3.7 3.8 3.9 3.10' + default: '3.7 3.8 3.9 3.10' type: string name: description: 'Name of the tool.' From 3f489f0bed14cf064bc06ef0ca4948d0357b64d3 Mon Sep 17 00:00:00 2001 From: umarcor Date: Thu, 6 Jan 2022 23:37:49 +0100 Subject: [PATCH 02/13] Parameters: add option 'system_list'; UnitTesting now requires field 'system' in the matrix --- .github/workflows/Parameters.yml | 31 +++++++++++++++++++++++++------ .github/workflows/UnitTesting.yml | 7 ++++--- ExamplePipeline.yml | 1 + 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 8668a3d..128ca36 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -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}') diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index ada82b4..7a88ddf 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -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 diff --git a/ExamplePipeline.yml b/ExamplePipeline.yml index 8e4af52..75c2745 100644 --- a/ExamplePipeline.yml +++ b/ExamplePipeline.yml @@ -34,6 +34,7 @@ jobs: with: name: ToolName # Optional + system_list: 'ubuntu windows macos' python_version: '3.10' python_version_list: '3.8 3.9 3.10' From 60d77c2292dd56d730b4be12a48a0ef46d4b4aec Mon Sep 17 00:00:00 2001 From: umarcor Date: Fri, 7 Jan 2022 01:02:31 +0100 Subject: [PATCH 03/13] Parameters: support system 'msys2' (MINGW64); update UnitTesting accordingly --- .github/workflows/Parameters.yml | 15 +++++++++------ .github/workflows/UnitTesting.yml | 18 +++++++++++++++--- ExamplePipeline.yml | 2 +- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 128ca36..57ffb43 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -38,7 +38,7 @@ on: system_list: description: 'Space separated list of systems to run tests on.' required: false - default: 'ubuntu windows macos' + default: 'ubuntu windows msys2 macos' type: string name: description: 'Name of the tool.' @@ -93,20 +93,23 @@ jobs: '3.10': { 'icon': '🟢', 'until': '2026.10' }, }, 'sys': { - 'ubuntu': '🐧', - 'windows': '🧊', - 'macos': '🍎', + 'ubuntu': { 'icon': '🐧', 'runs-on': 'ubuntu-latest', 'shell': 'bash' }, + 'windows': { 'icon': '🧊', 'runs-on': 'windows-latest', 'shell': 'pwsh' }, + 'msys2': { 'icon': '🟦', 'runs-on': 'windows-latest', 'shell': 'msys2 {0}' }, + 'macos': { 'icon': '🍎', 'runs-on': 'macos-latest', 'shell': 'bash' } } } jobs = [ { - 'sysicon': data['sys'][system], + 'sysicon': data['sys'][system]['icon'], 'system': system, + 'runs-on': data['sys'][system]['runs-on'], + 'shell': data['sys'][system]['shell'], 'pyicon': data['python'][version]['icon'], 'python': version } 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("Python jobs:") diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index 7a88ddf..5184b7a 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -49,18 +49,31 @@ jobs: UnitTesting: name: ${{ matrix.sysicon }} ${{ matrix.pyicon }} Unit Tests using Python ${{ matrix.python }} - runs-on: ${{ matrix.system }}-latest + runs-on: ${{ matrix.runs-on }} strategy: fail-fast: false matrix: include: ${{ fromJson(inputs.jobs) }} + defaults: + run: + shell: ${{ matrix.shell }} + steps: - name: ⏬ Checkout repository 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 with: python-version: ${{ matrix.python }} @@ -71,7 +84,6 @@ 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 diff --git a/ExamplePipeline.yml b/ExamplePipeline.yml index 75c2745..c3ba577 100644 --- a/ExamplePipeline.yml +++ b/ExamplePipeline.yml @@ -34,7 +34,7 @@ jobs: with: name: ToolName # Optional - system_list: 'ubuntu windows macos' + system_list: 'ubuntu windows msys2 macos' python_version: '3.10' python_version_list: '3.8 3.9 3.10' From dad5e71bfedeb76a25b3a7f0cf655a53157345d9 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 9 Jan 2022 17:39:16 +0100 Subject: [PATCH 04/13] Added PowerShell code. --- .github/workflows/UnitTesting.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index 5184b7a..b638ada 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -64,16 +64,16 @@ jobs: - name: ⏬ Checkout repository uses: actions/checkout@v2 - - if: matrix.system == 'msys2' - name: '🟦 Setup MSYS2' + - name: '🟦 Setup MSYS2' + if: matrix.system == 'msys2' uses: msys2/setup-msys2@v2 with: msystem: MINGW64 update: true pacboy: python-pip:p - - if: matrix.system != 'msys2' - name: 🐍 Setup Python ${{ matrix.python }} + - name: 🐍 Setup Python ${{ matrix.python }} + if: matrix.system != 'msys2' uses: actions/setup-python@v2 with: python-version: ${{ matrix.python }} @@ -84,6 +84,13 @@ jobs: python -m pip install ${{ inputs.requirements }} - name: ☑ Run unit tests + if: matrix.system == 'windows' + run: | + $PYTEST_ARGS = if (${{ inputs.artifact }} -eq "") { '--junitxml=TestReport.xml' } else { '' } + python -m pytest -rA ${{ inputs.unittest_directory }} $PYTEST_ARGS --color=yes + + - name: ☑ Run unit tests + if: matrix.system != 'windows' run: | [ 'x${{ inputs.artifact }}' != 'x' ] && PYTEST_ARGS='--junitxml=TestReport.xml' || unset PYTEST_ARGS python -m pytest -rA ${{ inputs.unittest_directory }} $PYTEST_ARGS --color=yes From e1f7599d793a3a0f9bcf15a30c31a8a2c90228ff Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 9 Jan 2022 18:00:36 +0100 Subject: [PATCH 05/13] Added Python 3.11 (currently RC). --- .github/workflows/Parameters.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 57ffb43..0185534 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -86,11 +86,12 @@ jobs: print('WARNING: support for Python 3.6 ended in 2021.12.23') data = { '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' }, + '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' }, + '3.11': { 'icon': '🟣', 'until': '2027.10' }, }, 'sys': { 'ubuntu': { 'icon': '🐧', 'runs-on': 'ubuntu-latest', 'shell': 'bash' }, From 0fdef33cb47df825faf78be6cbf80bf20528ec42 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 9 Jan 2022 18:10:42 +0100 Subject: [PATCH 06/13] Improved PoSh code. --- .github/workflows/UnitTesting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index b638ada..b006c52 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -86,7 +86,7 @@ jobs: - name: ☑ Run unit tests if: matrix.system == 'windows' run: | - $PYTEST_ARGS = if (${{ inputs.artifact }} -eq "") { '--junitxml=TestReport.xml' } else { '' } + $PYTEST_ARGS = if ("${{ inputs.artifact }}".length -gt 0) { "--junitxml=TestReport.xml" } else { "" } python -m pytest -rA ${{ inputs.unittest_directory }} $PYTEST_ARGS --color=yes - name: ☑ Run unit tests From 94bb01d5869e05c1f3b12f55b22e3b1c1c25df1f Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 9 Jan 2022 18:18:34 +0100 Subject: [PATCH 07/13] Renamed Python 3.11 version. --- .github/workflows/Parameters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 0185534..565fa1e 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -107,7 +107,7 @@ jobs: 'runs-on': data['sys'][system]['runs-on'], 'shell': data['sys'][system]['shell'], 'pyicon': data['python'][version]['icon'], - 'python': version + 'python': '3.11.0-alpha.3' if version == '3.11' else version } for system in systems for version in (versions if system != 'msys2' else ['3.9']) From c9bee6fe65e131d3e00c6f77ce2303c9617224ae Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 9 Jan 2022 18:44:06 +0100 Subject: [PATCH 08/13] Require wheel to be installed before installing requirements. --- .github/workflows/UnitTesting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index b006c52..de622f5 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -80,7 +80,7 @@ jobs: - name: 🔧 Install dependencies run: | - python -m pip install -U pip + python -m pip install -U pip wheel python -m pip install ${{ inputs.requirements }} - name: ☑ Run unit tests From e00f5cf53db2df47749f9835eb1738813073d8ab Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 9 Jan 2022 19:05:58 +0100 Subject: [PATCH 09/13] Added MSYS2-MinGW64 specific code. --- .github/workflows/UnitTesting.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index de622f5..7b6158e 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -79,10 +79,20 @@ jobs: python-version: ${{ matrix.python }} - name: 🔧 Install dependencies + if: matrix.system != 'msys2' run: | python -m pip install -U pip wheel python -m pip install ${{ inputs.requirements }} + - name: 🔧 Install dependencies + if: matrix.system == 'msys2' + run: | + pacman -S --noconfirm mingw64/mingw-w64-x86_64-python-wheel + pacman -S --noconfirm mingw64/mingw-w64-x86_64-python-coverage + pacman -S --noconfirm mingw64/mingw-w64-x86_64-python-lxml + python -m pip install -U pip + python -m pip install ${{ inputs.requirements }} + - name: ☑ Run unit tests if: matrix.system == 'windows' run: | From edb6ca364e962ce678a75dae35496cf103ceb873 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sun, 9 Jan 2022 19:40:20 +0100 Subject: [PATCH 10/13] UnitTesting/msys2: install system packages through 'pacboy' --- .github/workflows/UnitTesting.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index 7b6158e..cab9716 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -70,7 +70,11 @@ jobs: with: msystem: MINGW64 update: true - pacboy: python-pip:p + pacboy: >- + python-pip:p + python-wheel:p + python-coverage:p + python-lxml:p - name: 🐍 Setup Python ${{ matrix.python }} if: matrix.system != 'msys2' @@ -87,9 +91,6 @@ jobs: - name: 🔧 Install dependencies if: matrix.system == 'msys2' run: | - pacman -S --noconfirm mingw64/mingw-w64-x86_64-python-wheel - pacman -S --noconfirm mingw64/mingw-w64-x86_64-python-coverage - pacman -S --noconfirm mingw64/mingw-w64-x86_64-python-lxml python -m pip install -U pip python -m pip install ${{ inputs.requirements }} From b3d8a9c5ec16686da46505b22de1a1a902eb064c Mon Sep 17 00:00:00 2001 From: umarcor Date: Sun, 9 Jan 2022 19:49:20 +0100 Subject: [PATCH 11/13] UnitTesting: refactor --- .github/workflows/UnitTesting.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index cab9716..f2cb927 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -82,17 +82,16 @@ jobs: with: python-version: ${{ matrix.python }} - - name: 🔧 Install dependencies + - name: ⚙️ Update pip + run: python -m pip install -U pip + + - name: ⚙️ Install wheel if: matrix.system != 'msys2' run: | - python -m pip install -U pip wheel - python -m pip install ${{ inputs.requirements }} + python -m pip install -U wheel - name: 🔧 Install dependencies - if: matrix.system == 'msys2' - run: | - python -m pip install -U pip - python -m pip install ${{ inputs.requirements }} + run: python -m pip install ${{ inputs.requirements }} - name: ☑ Run unit tests if: matrix.system == 'windows' From 83cd57269412bcf2d83e31e602e30e08faef55e9 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sun, 9 Jan 2022 20:39:12 +0100 Subject: [PATCH 12/13] UnitTesting: update description of input 'jobs' --- .github/workflows/UnitTesting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index f2cb927..f6b3a99 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -26,7 +26,7 @@ on: workflow_call: inputs: jobs: - description: 'JSON list with field , telling the versions to run tests with.' + description: 'JSON list with environment fields, telling the system and Python versions to run tests with.' required: true type: string requirements: From 997d548e60087275e37e6139689549aa88af4d63 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sun, 9 Jan 2022 20:39:36 +0100 Subject: [PATCH 13/13] Parameters: update py36 warning, add py311 notice --- .github/workflows/Parameters.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 565fa1e..5438a09 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -83,7 +83,9 @@ jobs: 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') + print("::warning title=Deprecated::Support for Python 3.6 ended in 2021.12.23.") + if '3.11' in versions: + print(f"::notice title=Experimental::Python 3.11 (3.11.0-alpha3) is a pre-release.") data = { 'python': { '3.6': { 'icon': '⚫', 'until': '2021.12.23' },