Skip to content

Commit

Permalink
ci: generate code coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
falko17 committed Dec 7, 2021
1 parent 66c97d1 commit cb0c83e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ before_script:
- export PATH="$PATH":"~/.pub-cache/bin"
- pub get --no-precompile
- pub global activate junitreport
- pub global activate junitreport
- pub global activate coverage
- pub global activate -sgit https://github.com/Workiva/lsif_indexer
- apt -qq update
- apt -qq install -y python3 python3-distutils # unfortunately necessary to convert lcov reports to cobertura
- curl -o lcov_cobertura.py https://raw.githubusercontent.com/eriwen/lcov-to-cobertura-xml/master/lcov_cobertura/lcov_cobertura.py

style_check:
stage: test
Expand All @@ -30,13 +33,17 @@ lint:
test:
stage: test
script:
- pub run test $PUB_VARS > report.jsonl
- pub run test $PUB_VARS --coverage=./coverage > report.jsonl
- pub global run junitreport:tojunit --input report.jsonl --output report.xml
- pub global run coverage:format_coverage --packages=.packages --report-on=lib --lcov -o ./coverage/lcov.info -i ./coverage
- python3 lcov_cobertura.py ./coverage/test/* -o ./coverage.xml
artifacts:
when: always
reports:
junit:
- report.xml
cobertura:
- coverage.xml

code_quality:
stage: test
Expand Down

0 comments on commit cb0c83e

Please sign in to comment.