Add code coverage
Some checks failed
Bandit / audit-runtime-security (3.11) (pull_request) Successful in 9m57s
Flake8 / audit (3.11) (pull_request) Successful in 10m0s
Mypy / audit-typing (3.11) (pull_request) Successful in 10m34s
pip-audit / audit-dependency-security (3.11) (pull_request) Successful in 11m15s
Pylint / audit-runtime-security (3.11) (pull_request) Successful in 10m26s
Python Coverage / test-and-coverage (3.11) (pull_request) Failing after 5m31s
Some checks failed
Bandit / audit-runtime-security (3.11) (pull_request) Successful in 9m57s
Flake8 / audit (3.11) (pull_request) Successful in 10m0s
Mypy / audit-typing (3.11) (pull_request) Successful in 10m34s
pip-audit / audit-dependency-security (3.11) (pull_request) Successful in 11m15s
Pylint / audit-runtime-security (3.11) (pull_request) Successful in 10m26s
Python Coverage / test-and-coverage (3.11) (pull_request) Failing after 5m31s
This commit is contained in:
50
.gitea/workflows/python-coverage.yml
Normal file
50
.gitea/workflows/python-coverage.yml
Normal file
@ -0,0 +1,50 @@
|
||||
name: Python Coverage
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test-and-coverage:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version:
|
||||
- "3.11"
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '${{ matrix.python-version }}'
|
||||
cache: 'pip'
|
||||
cache-dependency-path: 'requirements.txt'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
python -m pip install --upgrade pytest-cov
|
||||
|
||||
- name: Run tests with coverage
|
||||
run: |
|
||||
pytest --cov=./ --cov-report=term --cov-report=xml --cov-report=html --junitxml=report.xml
|
||||
|
||||
- name: Upload coverage artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage-reports
|
||||
path: |
|
||||
coverage.xml
|
||||
htmlcov/
|
||||
|
||||
- name: Upload test results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: test-results
|
||||
path: report.xml
|
||||
Reference in New Issue
Block a user