StaticTypeCheck
This job runs a static type check using mypy and collects the results. These results can be converted to a HTML report and then uploaded as an artifact.
Behavior:
Checkout repository
Setup Python and install dependencies
Run type checking command(s).
Upload type checking report as an artifact
Dependencies:
Instantiation
Simple Example
jobs:
StaticTypeCheck:
uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@r0
with:
commands: |
touch pyTooling/__init__.py
mypy --html-report htmlmypy -p pyTooling
report: 'htmlmypy'
artifact: TypeChecking
Complex Example
jobs:
StaticTypeCheck:
uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@r0
needs:
- Params
with:
python_version: ${{ needs.Params.outputs.python_version }}
commands: |
touch pyTooling/__init__.py
mypy --html-report htmlmypy -p pyTooling
report: 'htmlmypy'
artifact: ${{ fromJson(needs.Params.outputs.artifact_names).statictyping_html }}
Commands
Example commands
:
Regular package
commands: mypy --html-report htmlmypy -p ToolName
Parent namespace package
commands: | touch Parent/__init__.py mypy --html-report htmlmypy -p ToolName
Child namespace package
commands: | cd Parent mypy --html-report ../htmlmypy -p ToolName
Parameters
python_version
Parameter Name |
Required |
Type |
Default |
---|---|---|---|
python_version |
optional |
string |
|
Python version.
requirements
Parameter Name |
Required |
Type |
Default |
---|---|---|---|
requirements |
optional |
string |
|
Python dependencies to be installed through pip.
commands
Parameter Name |
Required |
Type |
Default |
---|---|---|---|
commands |
yes |
string |
— — — — |
Commands to run the static type checks.
html_report
Parameter Name |
Required |
Type |
Default |
---|---|---|---|
report |
optional |
string |
|
HTML output directory to upload as an artifact.
junit_report
Parameter Name |
Required |
Type |
Default |
---|---|---|---|
report |
optional |
string |
|
junit file to upload as an artifact.
html_artifact
Parameter Name |
Required |
Type |
Default |
---|---|---|---|
html_artifact |
yes |
string |
— — — — |
Name of the typing artifact (HTML report).
junit_artifact
Parameter Name |
Required |
Type |
Default |
---|---|---|---|
junit_artifact |
optional |
string |
|
Name of the typing junit artifact (junit XML).
Secrets
This job template needs no secrets.
Results
This job template has no output parameters.