Skip to content

Commit

Permalink
Add custom-pytest argument (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw authored Mar 20, 2023
1 parent 8942cb9 commit c9e5b9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ When `job-summary` is set to `true`, the action will output a Job Summary.
| verbose | Verbose output | `false` | true |
| emoji | Use emojis in the output | `false` | true |
| custom-arguments | Custom arguments to pass to pytest | `false` | |
| custom-pytest | Custom command to replace the `pytest` call. Can be a custom executable or something like `poetry run pytest` or `micromamba run -n myenv pytest`. | `false` | pytest |
| report-title | Title of the report | `false` | Test Report |
| click-to-expand | Add 'Click to expand' to the report | `false` | true |
<!-- action-docs-inputs -->
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ inputs:
description: Custom arguments to pass to pytest
required: false
default: ''
custom-pytest:
description: Custom command to replace the `pytest` call. Can be a custom executable or something like `poetry run pytest` or `micromamba run -n myenv pytest`.
required: false
default: 'pytest'
report-title:
description: Title of the report
required: false
Expand All @@ -41,7 +45,7 @@ runs:
# unpack custom arguments from spaces to array
args+=(`echo "${{ inputs.custom-arguments }}"`)
echo "::group::Run pytest ${args[@]}"
pytest "${args[@]}"
${{ inputs.custom-pytest }} "${args[@]}"
echo "::endgroup::"
shell: bash -el {0} # use login shell to source .bashrc for environments
- name: Add report to summary
Expand Down

0 comments on commit c9e5b9c

Please sign in to comment.