Skip to content

[pre-commit.ci] pre-commit autoupdate #746

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #746

Workflow file for this run

name: coverage
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
BACKEND_DIR: "${{ github.workspace }}/.local"
BACKEND_VERSION: "2.28.8"
steps:
- uses: actions/checkout@v4
- name: Build backend
run: |
./scripts/download-mbedtls.sh $BACKEND_VERSION $BACKEND_DIR/src
./scripts/install-mbedtls.sh $BACKEND_DIR/src $BACKEND_DIR
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: |
requirements.txt
requirements/tests.txt
- name: Install deps
run: |
python -m pip install -r requirements.txt -r requirements/tests.txt
# Cython 3+ required for proper coverage.exclude_lines handling.
python -m pip install --pre --upgrade cython
- name: Build and install
env:
C_INCLUDE_PATH: "${{ env.BACKEND_DIR }}/include"
LIBRARY_PATH: "${{ env.BACKEND_DIR }}/lib"
run: python setup.py --with-coverage build_ext --inplace
- name: Run tests
env:
LD_LIBRARY_PATH: "${{ env.BACKEND_DIR }}/lib"
PYTHONPATH: src
run: python -m pytest --cov=src/ tests/ -k "not e2e"
- name: Upload to coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYTHONPATH: src
run: |
python -m pip install coveralls
coveralls --service=github