diff --git a/action.yml b/action.yml index 28351f4..01485c9 100644 --- a/action.yml +++ b/action.yml @@ -8,38 +8,42 @@ inputs: description: "A list of all paths to test" required: false default: "." + command: + description: "Initial command specially for poetry" + required: false + default: "" use-pylint: description: "Use Pylint" required: false - default: true + default: false use-pycodestyle: description: "Use pycodestyle" required: false - default: true + default: false use-flake8: description: "Use Flake8" required: false - default: true + default: false use-black: description: "Use Black" required: false - default: true + default: false use-mypy: description: "Use mypy" required: false - default: true + default: false use-isort: description: "Use isort" required: false - default: true + default: false use-vulture: description: "Use vulture" required: false - default: true + default: false use-pydocstyle: description: "Use pydocstyle" required: false - default: true + default: false extra-pylint-options: description: "Extra options: pylint $(extra-pylint-options) $(python-root-list)" required: false @@ -76,6 +80,10 @@ inputs: description: "Set desired python version with this keyword" required: false default: "3.8" + cache-type: + description: "Set cache for setup python" + required: true + default: "poetry" runs: using: "composite" @@ -85,22 +93,22 @@ runs: with: python-version: ${{ inputs.python-version }} architecture: x64 - cache: poetry - + cache: ${{ inputs.cache-type }} + - run: python --version shell: bash - - name: Windows install dependencies - if: ${{ runner.os == 'Windows' }} - run: | - pip install -r ${{ github.action_path }}\requirements.txt - echo "path_sep=" >> $GITHUB_ENV - shell: pwsh - - - name: Posix install dependencies - if: ${{ runner.os != 'Windows' }} - run: pip install -r ${{ github.action_path }}/requirements.txt - shell: bash + # - name: Windows install dependencies + # if: ${{ runner.os == 'Windows' }} + # run: | + # pip install -r ${{ github.action_path }}\requirements.txt + # echo "path_sep=" >> $GITHUB_ENV + # shell: pwsh + # + # - name: Posix install dependencies + # if: ${{ runner.os != 'Windows' }} + # run: pip install -r ${{ github.action_path }}/requirements.txt + # shell: bash - name: Lint on Windows if: ${{ runner.os == 'Windows' }} @@ -123,6 +131,7 @@ runs: '${{ inputs.extra-isort-options }}' '${{ inputs.extra-vulture-options }}' '${{ inputs.extra-pydocstyle-options }}' + '${{ inputs.command }}' shell: pwsh - name: Lint on Linux @@ -146,4 +155,5 @@ runs: '${{ inputs.extra-isort-options }}' '${{ inputs.extra-vulture-options }}' '${{ inputs.extra-pydocstyle-options }}' + '${{ inputs.command }}' shell: bash diff --git a/entrypoint.sh b/entrypoint.sh index 0e84798..b026e43 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -35,6 +35,7 @@ echo extra-mypy-options: ${14} echo extra-isort-options: ${15} echo extra-vulture-options: ${16} echo extra-pydocstyle-options: ${17} +echo command: ${18} # actions path has the copy of this actions repo echo $RUNNER_OS @@ -56,9 +57,9 @@ export TERM=xterm if [ "$2" = true ] ; then - echo Running: pylint ${10} $1 + echo Running: ${18} pylint ${10} $1 - pylint --output-format="colorized" ${10} $1 + ${18} pylint --output-format="colorized" ${10} $1 exit_code=$? if [ "$exit_code" = "0" ]; then @@ -71,9 +72,9 @@ fi if [ "$3" = true ] ; then - echo Running: pycodestyle ${11} $1 + echo Running: ${18} pycodestyle ${11} $1 - pycodestyle ${11} $1 + ${18} pycodestyle ${11} $1 exit_code=$? if [ "$exit_code" = "0" ]; then @@ -86,9 +87,9 @@ fi if [ "$4" = true ] ; then - echo Running: flake8 ${12} $1 + echo Running: ${18} flake8 ${12} $1 - flake8 ${12} $1 + ${18} flake8 ${12} $1 exit_code=$? if [ "$exit_code" = "0" ]; then @@ -101,9 +102,9 @@ fi if [ "$5" = true ] ; then - echo Running: black --check ${13} $1 + echo Running: ${18} black --check ${13} $1 - black --check ${13} $1 + ${18} black --check ${13} $1 exit_code=$? if [ "$exit_code" = "0" ]; then @@ -116,9 +117,9 @@ fi if [ "$6" = true ] ; then - echo Running: mypy --install-types --non-interactive --ignore-missing-imports --follow-imports=silent --show-column-numbers ${14} $1 + echo Running: ${18} mypy --install-types --non-interactive --ignore-missing-imports --follow-imports=silent --show-column-numbers ${14} $1 - mypy \ + ${18} mypy \ --install-types --non-interactive \ --ignore-missing-imports \ --follow-imports=silent \ @@ -135,9 +136,9 @@ fi if [ "$7" = true ] ; then - echo Running: isort ${15} $1 -c --diff + echo Running: ${18} isort ${15} $1 -c --diff - isort ${15} $1 -c --diff + ${18} isort ${15} $1 -c --diff exit_code=$? if [ "$exit_code" = "0" ]; then @@ -150,9 +151,9 @@ fi if [ "$8" = true ] ; then - echo Running: vulture ${16} $1 + echo Running: ${18} vulture ${16} $1 - vulture ${16} $1 + ${18} vulture ${16} $1 exit_code=$? if [ "$exit_code" = "0" ]; then @@ -165,9 +166,9 @@ fi if [ "$9" = true ] ; then - echo Running: pydocstyle ${17} $1 + echo Running: ${18} pydocstyle ${17} $1 - pydocstyle ${17} $1 + ${18} pydocstyle ${17} $1 exit_code=$? if [ "$exit_code" = "0" ]; then diff --git a/requirements.txt b/requirements.txt index b508a9c..0585199 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # black==21.11b1 -flake8==4.0.1 +flake8==6.0.0 isort==5.10.1 mypy~=0.961 # pycodestyle==2.8.0