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
12 changes: 6 additions & 6 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ jobs:
python -m pip install --upgrade pip
pip install pytest-xdist
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f "setup.py" ]; then pip install -e .; else export PYTHONPATH=$PYTHONPATH:./src; fi
if [ -f "pyproject.toml" ]; then pip install -e .[docs]; fi
if [ -f "setup.py" ]; then pip install -e .[all]; else export PYTHONPATH=$PYTHONPATH:./src; fi
if [ -f "pyproject.toml" ]; then pip install -e .[all]; fi
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
- name: Setup with pytest-xdist
run: |
Expand All @@ -90,7 +90,7 @@ jobs:
#
# make PYTESTXDIST
export PYTESTXDIST="-n ${{ inputs.pytest_numcpus }}"
if [ ${{ inputs.pytest_numcpus }} -gt 0 ]; then export PYTESTXDIST="$PYTESTXDIST --dist=loadfile"; fi
if [[ ${{ inputs.pytest_numcpus }} -gt 0 ]]; then export PYTESTXDIST="$PYTESTXDIST --dist=loadfile"; fi
#
# echo results and save env var for other jobs
echo "pytest-xdist options that will be used are: $PYTESTXDIST"
Expand All @@ -106,7 +106,7 @@ jobs:
#
# make PYTESTCOV
export PYTESTCOV="--cov=${{ inputs.pytest_cov_dir }} --cov-report=xml"
if [ ${{ inputs.pytest_cov_dir }} == "unassigned" ]; then export PYTESTCOV=""; fi
if [[ ${{ inputs.pytest_cov_dir }} == "unassigned" ]]; then export PYTESTCOV=""; fi
#
# echo results and save env var for other jobs
echo "pytest-cov options that will be used are: $PYTESTCOV"
Expand All @@ -116,11 +116,11 @@ jobs:
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
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
if [[ "${{ inputs.test_dir }}" != "" ]]; then cd ${{ inputs.test_dir }}; fi
coverage report -m
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
Expand Down