From 165cd5ec242df1f6a5a5d6ec99f0b3c49d4531f8 Mon Sep 17 00:00:00 2001 From: umarcor Date: Mon, 29 Nov 2021 02:42:39 +0100 Subject: [PATCH] StaticTypeCheck: add options 'html_report' and 'mypy_args', remove 'package' --- .github/workflows/StaticTypeCheck.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/StaticTypeCheck.yml b/.github/workflows/StaticTypeCheck.yml index 6ec6d02..5a97ebc 100644 --- a/.github/workflows/StaticTypeCheck.yml +++ b/.github/workflows/StaticTypeCheck.yml @@ -3,10 +3,6 @@ name: Static Type Check on: workflow_call: inputs: - package: - description: 'Name of the Python package.' - required: true - type: string python_version: description: 'Python version.' required: false @@ -17,6 +13,15 @@ on: required: false default: '-r tests/requirements.txt' type: string + html_report: + description: 'Directory for --html-report.' + required: false + default: 'htmlmypy' + type: string + mypy_args: + description: 'Arguments to mypy, except the HTML report (see option html_report).' + required: true + type: string artifact: description: 'Name of the coverage artifact.' required: true @@ -44,13 +49,16 @@ jobs: - name: Check Static Typing continue-on-error: true - run: mypy --html-report htmlmypy -m ${{ inputs.package }} + run: | + [ 'x${{ inputs.html_report }}' != 'x' ] && MYPY_HTML='--html-report=${{ inputs.html_report }}' || unset MYPY_HTML + mypy $MYPY_HTML ${{ inputs.mypy_args }} - name: 📤 Upload 'Static Typing Report' artifact + if: ${{ inputs.html_report != '' }} continue-on-error: true uses: actions/upload-artifact@v2 with: name: ${{ inputs.artifact }} - path: htmlmypy + path: ${{ inputs.html_report }} if-no-files-found: error retention-days: 1