From 4220a50041aa3910907b58af95406697f750e2f0 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sun, 16 Jan 2022 22:22:49 +0100 Subject: [PATCH] UnitTesting: add options 'pacboy' and 'mingw_requirements' --- .github/workflows/UnitTesting.yml | 33 +++++++++++++++++++++++-------- ExamplePipeline.yml | 7 +++++++ 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index f6b3a99..d5cbee6 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -34,6 +34,20 @@ on: required: false default: '-r tests/requirements.txt' type: string + pacboy: + description: 'MSYS2 dependencies to be installed through pacboy (pacman).' + required: false + default: >- + python-pip:p + python-wheel:p + python-coverage:p + python-lxml:p + type: string + mingw_requirements: + description: 'Override Python dependencies to be installed through pip on MSYS2 (MINGW64) only.' + required: false + default: '' + type: string unittest_directory: description: 'Path to the directory containing unit tests.' required: false @@ -70,11 +84,7 @@ jobs: with: msystem: MINGW64 update: true - pacboy: >- - python-pip:p - python-wheel:p - python-coverage:p - python-lxml:p + pacboy: ${{ inputs.pacboy }} - name: 🐍 Setup Python ${{ matrix.python }} if: matrix.system != 'msys2' @@ -85,13 +95,20 @@ jobs: - name: ⚙️ Update pip run: python -m pip install -U pip - - name: ⚙️ Install wheel + - name: 🔧 Install wheel and pip dependencies if: matrix.system != 'msys2' run: | python -m pip install -U wheel + python -m pip install ${{ inputs.requirements }} - - name: 🔧 Install dependencies - run: python -m pip install ${{ inputs.requirements }} + - name: 🔧 Install pip dependencies + if: matrix.system == 'msys2' + run: | + if [ 'x${{ inputs.mingw_requirements }}' != 'x' ]; then + python -m pip install ${{ inputs.mingw_requirements }} + else + python -m pip install ${{ inputs.requirements }} + fi - name: ☑ Run unit tests if: matrix.system == 'windows' diff --git a/ExamplePipeline.yml b/ExamplePipeline.yml index c3ba577..dffb331 100644 --- a/ExamplePipeline.yml +++ b/ExamplePipeline.yml @@ -46,6 +46,13 @@ jobs: jobs: ${{ needs.Params.outputs.python_jobs }} # Optional requirements: '-r tests/requirements.txt' + pacboy: >- + python-pip:p + python-wheel:p + python-coverage:p + python-lxml:p + mingw_requirements: '-r tests/requirements.mingw.txt' + unittest_directory: 'tests/unit' artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }} Coverage: