--- #748
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |