Skip to content

Commit c1db319

Browse files
committed
Check packages after install
1 parent 901871a commit c1db319

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

analyze-project/action.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,6 @@ inputs:
1919
runs:
2020
using: composite
2121
steps:
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: Echo check_tools outputs
41-
run: |
42-
echo "mypy installed: ${{ steps.check_tools.outputs.mypy }}"
43-
echo "pyright installed: ${{ steps.check_tools.outputs.pyright }}"
44-
shell: bash
4522
- name: Get package name and version
4623
id: get_package_info
4724
run: |
@@ -61,7 +38,7 @@ runs:
6138
key: ${{ inputs.package-name }}-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles(format('{0}/poetry.lock', inputs.project-directory)) }}
6239
- name: Install ${{ steps.get_package_info.outputs.name }}
6340
run: |
64-
if [ "${{ inputs.install-extras }}" != "" ]; then
41+
if [ "${{ inputs.extras }}" != "" ]; then
6542
EXTRAS_ARGS=""
6643
for extra in ${{ inputs.extras }}; do
6744
EXTRAS_ARGS="$EXTRAS_ARGS -E $extra"
@@ -76,6 +53,29 @@ runs:
7653
run: poetry run ni-python-styleguide lint
7754
working-directory: ${{ inputs.project-directory }}
7855
shell: bash
56+
- name: Check for mypy and pyright installation
57+
id: check_tools
58+
run: |
59+
python - <<EOF
60+
import os
61+
from importlib.metadata import version, PackageNotFoundError
62+
63+
def is_installed(pkg_name):
64+
try:
65+
version(pkg_name)
66+
return "true"
67+
except PackageNotFoundError:
68+
return "false"
69+
70+
print(f"::set-output name=mypy::{is_installed('mypy')}")
71+
print(f"::set-output name=pyright::{is_installed('pyright')}")
72+
EOF
73+
shell: bash
74+
- name: Echo check_tools outputs
75+
run: |
76+
echo "mypy installed: ${{ steps.check_tools.outputs.mypy }}"
77+
echo "pyright installed: ${{ steps.check_tools.outputs.pyright }}"
78+
shell: bash
7979
- name: Mypy static analysis
8080
if: steps.check_tools.outputs.mypy == 'true'
8181
run: poetry run mypy

0 commit comments

Comments
 (0)