.gitlab-ci.yml
changeset 53 3163ef9c9a2a
parent 52 83614f884e7a
equal deleted inserted replaced
52:83614f884e7a 53:3163ef9c9a2a
    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=$(/bin/grep -e '^[[:space:]]*[[:digit:]]\+[[:space:]]\+[[:digit:]]\+\%' ./coverage/coverage.log |
    33               mawk '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 %"
    38     artifacts:
    38     artifacts:
    39         paths:
    39         paths:
    40             - ./coverage/
    40             - ./coverage/