.gitlab-ci.yml
changeset 25 68fab7a5494d
parent 20 21dbcce467f3
child 26 62937d005eb7
equal deleted inserted replaced
24:7b9ac39c749a 25:68fab7a5494d
    24         - ./bin/buildout
    24         - ./bin/buildout
    25 
    25 
    26 test:
    26 test:
    27     stage: test
    27     stage: test
    28     script:
    28     script:
    29         - ./bin/test
    29         - pip install anybadge
       
    30         - mkdir ./coverage
       
    31         - ./bin/test --coverage coverage | tee ./coverage/coverage.log
       
    32         - GLOBAL_COVER=$(/bin/grep -e '^[[:space:]]*[[:digit:]]\+[[:space:]]\+[[:digit:]]\+\%' ./coverage/coverage.log |
       
    33               awk 'BEGIN { lines=0; cov=0 }
       
    34                    { lines = lines + $1; cov = cov + $1 * $2 / 100 }
       
    35                    END { printf "%.2f", cov / lines * 100 }')
       
    36         - anybadge --label=Coverage --file=./coverage/coverage.svg --value=$GLOBAL_COVER 20=red 40=orange 60=yellow 80=green
       
    37         - echo "Global tests coverage is $GLOBAL_COVER %"
       
    38     artifacts:
       
    39         paths:
       
    40             - ./coverage/
    30 
    41 
    31 dist:
    42 dist:
    32     stage: dist
    43     stage: dist
    33     script:
    44     script:
    34         - ./bin/buildout setup setup.py clean --all sdist bdist_egg bdist_wheel
    45         - ./bin/buildout setup setup.py clean --all sdist bdist_egg bdist_wheel