diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 085dc13..5438a09 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -33,7 +33,12 @@ 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 + system_list: + description: 'Space separated list of systems to run tests on.' + required: false + default: 'ubuntu windows msys2 macos' type: string name: description: 'Name of the tool.' @@ -75,19 +80,39 @@ 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') + 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 = { - '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' }, + '3.11': { 'icon': '🟣', 'until': '2027.10' }, + }, + 'sys': { + '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 = [ - {'python': version, 'icon': data[version]['icon']} - for version in versions + { + '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': '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']) ] 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 ada82b4..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: @@ -48,29 +48,59 @@ 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.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 MSYS2' + if: matrix.system == 'msys2' + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + update: true + pacboy: >- + python-pip:p + python-wheel:p + python-coverage:p + python-lxml:p + - name: 🐍 Setup Python ${{ matrix.python }} + if: matrix.system != 'msys2' uses: actions/setup-python@v2 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 - python -m pip install ${{ inputs.requirements }} + python -m pip install -U wheel + + - name: 🔧 Install dependencies + run: python -m pip install ${{ inputs.requirements }} - name: ☑ Run unit tests + if: matrix.system == 'windows' + run: | + $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 + 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 @@ -79,7 +109,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/.idea/Actions.iml b/.idea/Actions.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/Actions.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..91c1f7c --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/ExamplePipeline.yml b/ExamplePipeline.yml index 8e4af52..c3ba577 100644 --- a/ExamplePipeline.yml +++ b/ExamplePipeline.yml @@ -34,6 +34,7 @@ jobs: with: name: ToolName # Optional + system_list: 'ubuntu windows msys2 macos' python_version: '3.10' python_version_list: '3.8 3.9 3.10'