mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
StaticTypeCheck: require the user to specify the mypy commands
This commit is contained in:
1
.github/workflows/Params.yml
vendored
1
.github/workflows/Params.yml
vendored
@@ -40,7 +40,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
name = '${{ inputs.name }}'
|
name = '${{ inputs.name }}'
|
||||||
params = {
|
params = {
|
||||||
'name': name,
|
|
||||||
'python_version': '${{ inputs.python_version }}',
|
'python_version': '${{ inputs.python_version }}',
|
||||||
'artifacts': {
|
'artifacts': {
|
||||||
'unittesting': f'{name}-TestReport',
|
'unittesting': f'{name}-TestReport',
|
||||||
|
|||||||
16
.github/workflows/StaticTypeCheck.yml
vendored
16
.github/workflows/StaticTypeCheck.yml
vendored
@@ -13,13 +13,13 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: '-r tests/requirements.txt'
|
default: '-r tests/requirements.txt'
|
||||||
type: string
|
type: string
|
||||||
html_report:
|
report:
|
||||||
description: 'Directory for --html-report.'
|
description: 'Directory to upload as an artifact.'
|
||||||
required: false
|
required: false
|
||||||
default: 'htmlmypy'
|
default: 'htmlmypy'
|
||||||
type: string
|
type: string
|
||||||
mypy_args:
|
commands:
|
||||||
description: 'Arguments to mypy, except the HTML report (see option html_report).'
|
description: 'Commands to run the static type checks.'
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
artifact:
|
artifact:
|
||||||
@@ -49,16 +49,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Check Static Typing
|
- name: Check Static Typing
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: ${{ inputs.commands }}
|
||||||
[ '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 != '' }}
|
if: ${{ inputs.artifact != '' }}
|
||||||
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: ${{ inputs.html_report }}
|
path: ${{ inputs.report }}
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|||||||
@@ -40,12 +40,12 @@ jobs:
|
|||||||
needs:
|
needs:
|
||||||
- Params
|
- Params
|
||||||
with:
|
with:
|
||||||
mypy_args: -m ${{ fromJson(needs.Params.outputs.params).name }}
|
commands: mypy --html-report htmlmypy -p ToolName
|
||||||
artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.typing }}
|
artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.typing }}
|
||||||
# Optional
|
# Optional
|
||||||
python_version: ${{ fromJson(needs.Params.outputs.params).python_version }}
|
python_version: ${{ fromJson(needs.Params.outputs.params).python_version }}
|
||||||
requirements: '-r tests/requirements.txt'
|
requirements: '-r tests/requirements.txt'
|
||||||
html_report: 'htmlmypy'
|
report: 'htmlmypy'
|
||||||
|
|
||||||
Release:
|
Release:
|
||||||
uses: pyTooling/Actions/.github/workflows/Release.yml@dev
|
uses: pyTooling/Actions/.github/workflows/Release.yml@dev
|
||||||
|
|||||||
Reference in New Issue
Block a user