Skip to content

Feedback

Feedback #737

name: Pytest Coverage Calculation
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- run: wget https://sqlite.org/2022/sqlite-autoconf-3380500.tar.gz
- run: tar -xvf sqlite-autoconf-3380500.tar.gz
- run: ./configure
working-directory: sqlite-autoconf-3380500
- run: make
working-directory: sqlite-autoconf-3380500
- run: sudo make install
working-directory: sqlite-autoconf-3380500
- run: export PATH="/usr/local/lib:$PATH"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
working-directory: src/backend
- name: Build coverage file
run: |
pytest --junitxml=pytest.xml --cov-report=term-missing --cov=. | tee pytest-coverage.txt
env:
LD_LIBRARY_PATH: /usr/local/lib
working-directory: src/backend
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: src/backend/pytest-coverage.txt
junitxml-path: src/backend/pytest.xml