-
Notifications
You must be signed in to change notification settings - Fork 28
53 lines (44 loc) · 1.47 KB
/
cov.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: coverage
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
BACKEND_DIR: "${{ github.workspace }}/.local"
BACKEND_VERSION: "2.28.3"
steps:
- uses: actions/checkout@v3
- 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@v4
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