mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
StaticTypeCheck: add options 'html_report' and 'mypy_args', remove 'package'
This commit is contained in:
20
.github/workflows/StaticTypeCheck.yml
vendored
20
.github/workflows/StaticTypeCheck.yml
vendored
@@ -3,10 +3,6 @@ name: Static Type Check
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
package:
|
|
||||||
description: 'Name of the Python package.'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
python_version:
|
python_version:
|
||||||
description: 'Python version.'
|
description: 'Python version.'
|
||||||
required: false
|
required: false
|
||||||
@@ -17,6 +13,15 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: '-r tests/requirements.txt'
|
default: '-r tests/requirements.txt'
|
||||||
type: string
|
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:
|
artifact:
|
||||||
description: 'Name of the coverage artifact.'
|
description: 'Name of the coverage artifact.'
|
||||||
required: true
|
required: true
|
||||||
@@ -44,13 +49,16 @@ jobs:
|
|||||||
|
|
||||||
- name: Check Static Typing
|
- name: Check Static Typing
|
||||||
continue-on-error: true
|
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
|
- name: 📤 Upload 'Static Typing Report' artifact
|
||||||
|
if: ${{ inputs.html_report != '' }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.artifact }}
|
name: ${{ inputs.artifact }}
|
||||||
path: htmlmypy
|
path: ${{ inputs.html_report }}
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|||||||
Reference in New Issue
Block a user