Skip to content

Commit

Permalink
Merge pull request #13 from generalui/test-python
Browse files Browse the repository at this point in the history
[test-python] Better syntax for github variables.
  • Loading branch information
jonryser authored Nov 1, 2024
2 parents a35c34d + 57e6447 commit b4a10e0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/actions/test-python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ runs:
else
coverage_arg=""
if [ ${{ inputs.min-coverage }} -gt 0 ]; then
coverage_arg="--cov-fail-under=${{ inputs.min-coverage }}"
coverage_arg="--cov-fail-under="${{ inputs.min-coverage }}
fi
pytest --cov --cov-report html -n auto $coverage_arg
fi
Expand All @@ -118,8 +118,11 @@ runs:
- name: Get the coverage file.
if: inputs.should-run-tests == 'yes' && inputs.upload-coverage == 'yes'
run: |
coverage_prefix=''
if [ ${{ inputs.coverage-prefix }} != '' ]; then
coverage_prefix=${{ inputs.coverage-prefix }}-
fi
coverage_branch=${${{ inputs.branch }}//+([\"\:<>|\*\?\\\/])/-}
coverage_prefix=${{ inputs.coverage-prefix != '' && "${{ inputs.coverage-prefix }}-" }}
coverage_dir=${coverage_prefix}coverage-${coverage_branch}
mkdir -p ${coverage_dir} && sudo cp -r coverage ${coverage_dir}
Expand Down

0 comments on commit b4a10e0

Please sign in to comment.