Skip to content

Create dependabot.yml #42

Create dependabot.yml

Create dependabot.yml #42

name: pytest MishaKav/pytest-coverage-comment
on:
push:
pull_request:
# https://docs.github.com/ja/actions/using-jobs/assigning-permissions-to-jobs
permissions:
# `contents` is for permission to the contents of the repository.
contents: write
checks: write
# `pull-requests` is for permission to pull request
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-md pytest-emoji pytest-cov requests
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run tests
run: |
set -o pipefail
python -m pytest --cov-report "xml:coverage.xml" --junitxml=pytest.xml --cov-report=term-missing --cov=. .
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-xml-coverage-path: ./coverage.xml
junitxml-path: ./pytest.xml
- name: Publish Test Results(Linux)
uses: EnricoMi/publish-unit-test-result-action/linux@v2
if: runner.os == 'Linux'
with:
files: |
./pytest.xml
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
./coverage.xml
./pytest.xml
- name: Code Coverage Report
uses: irongut/[email protected]
with:
filename: coverage.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '60 80'
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md