mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-05 04:28:12 +08:00
Show test coverage in github pull request comment (#344)
This commit is contained in:
+13
-26
@@ -7,6 +7,11 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
# for code coverage comment
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
env:
|
env:
|
||||||
MONGO_HOST: "127.0.0.1"
|
MONGO_HOST: "127.0.0.1"
|
||||||
REDIS_HOST: "127.0.0.1"
|
REDIS_HOST: "127.0.0.1"
|
||||||
@@ -83,11 +88,6 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
SERVICES: sqs
|
SERVICES: sqs
|
||||||
MINISTACK_HOST: aws
|
MINISTACK_HOST: aws
|
||||||
# options: >-
|
|
||||||
# --health-cmd "wget -qO- http://localhost:4566/_ministack/ready || exit 1"
|
|
||||||
# --health-interval 2s
|
|
||||||
# --health-retries 15
|
|
||||||
# --health-timeout 5s
|
|
||||||
ports:
|
ports:
|
||||||
- 4566:4566
|
- 4566:4566
|
||||||
steps:
|
steps:
|
||||||
@@ -105,25 +105,12 @@ jobs:
|
|||||||
run: aws sqs create-queue --queue-name testing
|
run: aws sqs create-queue --queue-name testing
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: |
|
run: |
|
||||||
uv run pytest --cov=./django_q --cov-report=xml
|
uv run pytest --cov=./django_q --cov-report=xml --junitxml=pytest.xml --cov-report=term-missing:skip-covered | tee pytest-coverage.txt
|
||||||
- name: Upload to coveralls
|
|
||||||
run: |
|
|
||||||
python -m pip install coveralls
|
|
||||||
coveralls --service=github
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
COVERALLS_FLAG_NAME: python-${{ matrix.python-version }}-django-${{ matrix.django }}
|
|
||||||
COVERALLS_PARALLEL: true
|
|
||||||
|
|
||||||
finish:
|
- name: Coverage comment
|
||||||
needs: test
|
if: matrix.python-version == '3.13' && matrix.django == '5.2' && github.event_name == 'pull_request'
|
||||||
runs-on: ubuntu-latest
|
uses: MishaKav/pytest-coverage-comment@v1
|
||||||
container: python:3.11-bookworm
|
with:
|
||||||
steps:
|
pytest-coverage-path: ./pytest-coverage.txt
|
||||||
- name: Upload to coveralls
|
junitxml-path: ./pytest.xml
|
||||||
run: |
|
report-only-changed-files: true
|
||||||
python -m pip install --upgrade pip
|
|
||||||
python -m pip install coveralls
|
|
||||||
coveralls --service=github --finish
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user