-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
124 lines (110 loc) · 2.9 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'web'
variables:
PUB_CACHE: $CI_PROJECT_DIR/.pub-cache
stages:
- install
- docs
- verify
- test
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- .pub-cache/
before_script:
- export PATH="$PATH":"$PUB_CACHE/bin"
- flutter pub get
- flutter pub run build_runner build
flutter_dependencies:
image: cirrusci/flutter:2.10.3
stage: install
before_script: []
script:
- flutter pub get
- dart --version
pages:
stage: docs
needs: [autogenerate_doc]
image: python:3.9
before_script: []
script:
- pip install -r ./docs/requirements.txt
- mkdocs build --verbose
artifacts:
paths:
- public
only:
- /^sprint-.*/
autogenerate_doc:
image: cirrusci/flutter:2.10.3
stage: docs
needs: [flutter_dependencies]
script:
- pub global activate dartdoc
- export PATH="$PATH":"$HOME/.pub-cache/bin"
- pub global run dartdoc .
artifacts:
name: doc
paths:
- $CI_PROJECT_DIR/doc
when: always
only:
- /^sprint-.*/
lint:
image: cirrusci/flutter:2.10.3
stage: verify
needs: [flutter_dependencies]
script:
- flutter analyze
code-quality:
image: cirrusci/flutter:2.10.3
stage: verify
needs: [flutter_dependencies]
script:
- pub global activate dart_code_metrics
- metrics lib --reporter=gitlab --exclude={/**.g.dart,/**.template.dart,/**.gr.dart} > gl-code-quality-report.json
artifacts:
reports:
codequality: gl-code-quality-report.json
unit-test:
image: cirrusci/flutter:2.10.3
stage: test
needs: [flutter_dependencies]
script:
- bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-dart/main/install.sh)
- pub global activate junitreport
- pub global activate remove_from_coverage
- flutter test --machine --coverage | tojunit -o report.xml
- remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$'
- remove_from_coverage -f coverage/lcov.info -r '\.gr\.dart$'
- lcov --summary coverage/lcov.info
- genhtml coverage/lcov.info --output=coverage
coverage: '/lines\.*: \d+\.\d+\%/'
artifacts:
name: coverage
paths:
- $CI_PROJECT_DIR/coverage
reports:
junit: report.xml
# integration-test:
# image: cirrusci/flutter:2.10.3
# stage: test
# needs: [flutter_dependencies]
# script:
# - sdkmanager --install "system-images;android-30;default;x86"
# - flutter emulators --create emulator1
# - flutter emulators --launch emulator1
# - android-wait-for-emulator
# - pub global activate junitreport
# - flutter test integration_test/ --machine --coverage | tojunit -o report.xml
# - lcov --summary coverage/lcov.info
# - genhtml coverage/lcov.info --output=coverage
# coverage: '/lines\.*: \d+\.\d+\%/'
# artifacts:
# name: coverage
# paths:
# - $CI_PROJECT_DIR/coverage
# reports:
# junit: report.xml