Skip to content

Commit 58e6ee6

Browse files
committed
ci(*): gitlab
1 parent 9503cc1 commit 58e6ee6

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.gitlab-ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
stages:
2+
- test
3+
- build_coverage
4+
- deploy_coverage
5+
6+
unit_test: # Name of the lane
7+
image: cirrusci/flutter:stable
8+
stage: test
9+
script:
10+
- /bin/sh bin/coverage-ci.sh
11+
artifacts:
12+
paths:
13+
- coverage/
14+
coverage: '/^lines\.+: |\d+\.?\d+\%/'
15+
except:
16+
- /^release-.*$/
17+
18+
coverage_test: # Name of the lane
19+
image: gableroux/flutter:v1.2.1
20+
stage: build_coverage
21+
script:
22+
- echo "${CODECOV_TOKEN}"
23+
- genhtml -o coverage coverage/lcov.info
24+
- bash <(curl -s https://codecov.io/bash) -t "${CODECOV_TOKEN}"
25+
artifacts:
26+
paths:
27+
- coverage/
28+
coverage: '/^lines\.+: |\d+\.?\d+\%/'
29+
except:
30+
- /^release-.*$/
31+
32+
pages:
33+
image: alpine
34+
stage: deploy_coverage
35+
dependencies:
36+
- unit_test
37+
script:
38+
- mkdir public
39+
- mv coverage/ public/coverage/
40+
artifacts:
41+
paths:
42+
- public
43+
# only:
44+
# - master

bin/coverage-ci.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
# Effective test coverage
4+
# Why --no-test-assets : https://github.com/flutter/flutter/issues/35907
5+
flutter test --coverage --no-test-assets
6+
7+
# Install https://pub.dev/packages/remove_from_coverage
8+
pub global activate remove_from_coverage
9+
10+
export PATH="$PATH":"$HOME/.pub-cache/bin"
11+
12+
# Remove Generate dart files
13+
remove_from_coverage -f coverage/lcov.info -r '.g.dart$'

0 commit comments

Comments
 (0)