Skip to content

Commit

Permalink
chore: improve github action test script (support debug)
Browse files Browse the repository at this point in the history
  • Loading branch information
luochen1990 committed Aug 1, 2024
1 parent 21ef687 commit 427fb8d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: |
python -m pip install --upgrade pip poetry
python -m pip install flake8 pytest pytest-xdist pytest-cov pyright
- name: Install The Tested Package
- name: Install This Package
run: |
if [[ "${{ github.event.head_commit.message }}" == "version:"* ]]; then
echo "This is a version bump commit. Installing the package from built wheel."
Expand All @@ -44,12 +44,19 @@ jobs:
run: |
if [[ "${{ github.event.head_commit.message }}" == "version:"* ]]; then
echo "This is a version bump commit, run test without coverage."
pytest -n0 -s
COV_ARG=""
else
echo "This is not a version bump commit, run test with coverage."
export DEBUG=true
pytest -n0 -s --cov=src --cov-report=term --cov-report=xml
COV_ARG="--cov=src --cov-report=term --cov-report=xml"
fi
export DEBUG=$RUNNER_DEBUG
if [ -n "$DEBUG" ]; then
DBG_ARG="-n0 -s"
else
DBG_ARG=""
fi
pytest $DBG_ARG $COV_ARG
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
Expand Down

0 comments on commit 427fb8d

Please sign in to comment.