.gitlab-ci.yml
changeset 439 d2a70e493aa8
parent 433 3e1e16d5bbaf
equal deleted inserted replaced
438:82836485546c 439:d2a70e493aa8
    27     stage: test
    27     stage: test
    28     script:
    28     script:
    29         - pip install anybadge
    29         - pip install anybadge
    30         - mkdir ./coverage
    30         - mkdir ./coverage
    31         - ./bin/test --coverage coverage | tee ./coverage/coverage.log
    31         - ./bin/test --coverage coverage | tee ./coverage/coverage.log
    32         - GLOBAL_COVER=$(/bin/grep -e '^[[:space:]]*[[:digit:]]\+[[:space:]]\+[[:digit:]]\+\%' ./coverage/coverage.log |
    32         - GLOBAL_COVER=$(grep -e '^[[:space:]]*[[:digit:]]\+[[:space:]]\+[[:digit:]]\+\%' ./coverage/coverage.log |
    33               awk 'BEGIN { lines=0; cov=0 }
    33               awk 'BEGIN { lines=0; cov=0 }
    34                    { lines = lines + $1; cov = cov + $1 * $2 / 100 }
    34                    { lines = lines + $1; cov = cov + $1 * $2 / 100 }
    35                    END { printf "%.2f", cov / lines * 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
    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 %"
    37         - echo "Global tests coverage is $GLOBAL_COVER %"