-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
67 lines (59 loc) · 1.86 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# https://hub.docker.com/_/dart
image: dart:latest
variables:
PUB_VARS: "--platform vm --timeout 30s --concurrency=6 --test-randomize-ordering-seed=random --reporter=json"
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
paths:
- .pub-cache/global_packages
before_script:
- export PATH="$PATH":"~/.pub-cache/bin"
- pub get --no-precompile
- 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 lcov 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
script:
- dart format -o none --set-exit-if-changed .
lint:
stage: test
script:
- dart analyze .
test:
stage: test
script:
- 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/lcov.info -o ./coverage.xml
- genhtml coverage/lcov.info
coverage: '/lines\.*: \d+\.\d+\%/'
artifacts:
when: always
reports:
junit:
- report.xml
cobertura:
- coverage.xml
code_quality:
stage: test
script:
- dart run dart_code_metrics:metrics analyze lib -r gitlab > quality.json
artifacts:
when: always
reports:
codequality:
- quality.json
code_navigation:
stage: test
allow_failure: true
script:
- pub global run lsif_indexer -o dump.lsif
artifacts:
reports:
lsif: dump.lsif