Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ name: Python Tests
on:
workflow_call:
inputs:
# Optional Hugging Face token.
# Callers can pass this as: secrets.HF_TOKEN
hf_token:
description: 'Optional Hugging Face token for tests'
required: false
type: string
default: ''

pytest_cov_dir:
required: false
type: string
Expand Down Expand Up @@ -116,12 +124,15 @@ jobs:
echo "pytest-cov options that will be used are: $PYTESTCOV"
echo "PYTESTCOV=$PYTESTCOV" >> $GITHUB_ENV
- name: Run pytest
env:
HF_TOKEN: ${{ inputs.hf_token }}
run: |
export PYTHONPATH=${PYTHONPATH}:${{ inputs.python_path }}
export PYTEST_COMMAND="pytest $PYTESTCOV $PYTESTXDIST -s"
echo "Will be running this command: $PYTEST_COMMAND"
if [ ${{ inputs.test_dir }} != '' ]; then cd ${{ inputs.test_dir }}; fi
eval $PYTEST_COMMAND

- name: Show coverage
run: |
if [ ${{ inputs.test_dir }} != '' ]; then cd ${{ inputs.test_dir }}; fi
Expand Down