File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,25 @@ inputs:
1919runs :
2020 using : composite
2121 steps :
22- - name : Get package name and version
22+ - name : Check for mypy and pyright installation
23+ id : check_tools
24+ run : |
25+ python - <<EOF
26+ import os
27+ from importlib.metadata import version, PackageNotFoundError
28+
29+ def is_installed(pkg_name):
30+ try:
31+ version(pkg_name)
32+ return "true"
33+ except PackageNotFoundError:
34+ return "false"
35+
36+ print(f"::set-output name=mypy::{is_installed('mypy')}")
37+ print(f"::set-output name=pyright::{is_installed('pyright')}")
38+ EOF
39+ shell : bash
40+ - name : Get package name and version
2341 id : get_package_info
2442 run : |
2543 result=$(poetry version -C "${{ inputs.project-directory }}")
@@ -54,10 +72,12 @@ runs:
5472 working-directory : ${{ inputs.project-directory }}
5573 shell : bash
5674 - name : Mypy static analysis
75+ if : steps.check_tools.outputs.mypy == 'true'
5776 run : poetry run mypy
5877 working-directory : ${{ inputs.project-directory }}
5978 shell : bash
6079 - name : Add virtualenv to the path for pyright-action
80+ if : steps.check_tools.outputs.pyright == 'true'
6181 shell : bash
6282 run : |
6383 VENV_PATH="$(poetry env info --path)"
6888 fi
6989 working-directory : ${{ inputs.project-directory }}
7090 - name : Pyright static analysis
91+ if : steps.check_tools.outputs.pyright == 'true'
7192 uses : jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2
7293 with :
7394 version : PATH
You can’t perform that action at this time.
0 commit comments