Verified Commit b723f63d authored by Karel Koci's avatar Karel Koci 🤘

Gitlab CI: add pages with code coverage

parent 51a98ca2
Pipeline #44852 passed with stages
in 34 seconds
......@@ -2,6 +2,7 @@ image: registry.labs.nic.cz/turris/pyuci
stages:
- test
- pages
python2:
stage: test
......@@ -18,3 +19,18 @@ python3:
- export LD_LIBRARY_PATH=/usr/local/lib
script:
- python3 -m pytest tests
# Let's generate coverage only using Python3
pages:
stage: pages
before_script:
- COVERAGE=y python3 setup.py install
- export LD_LIBRARY_PATH=/usr/local/lib
- python3 -m pytest tests
script:
- lcov --capture --no-external --base-directory . --directory build/temp.* --output-file coverage.info
- genhtml coverage.info --output-directory public/coverage-c
artifacts:
when: on_success
paths:
- public
import os
from setuptools import setup
from setuptools.extension import Extension
ext_compile_args = None
ext_link_args = None
if 'COVERAGE' in os.environ:
ext_compile_args = ["-fprofile-arcs", "-ftest-coverage"]
ext_link_args = ["-fprofile-arcs"]
setup(
name='pyuci',
version='0.3',
......@@ -11,6 +19,9 @@ setup(
license="MIT",
ext_modules=[
Extension("uci", ["ucimodule.c", "pyuci.c", "pyhelper.c"], libraries=["uci"])
Extension("uci", ["ucimodule.c", "pyuci.c", "pyhelper.c"],
libraries=["uci"], language="c",
extra_compile_args=ext_compile_args,
extra_link_args=ext_link_args)
],
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment