-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
70 lines (62 loc) · 1.84 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
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Dart.gitlab-ci.yml
image: dart:3
variables:
# To learn more go to https://dart.dev/tools/dart-test
# Or run `dart test --help`
PUB_VARS: "--chain-stack-traces --platform vm --timeout 30s --concurrency=6 --test-randomize-ordering-seed=random --reporter=expanded"
# Make PUB_CACHE cacheable in GitLab;
# see also https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77791/diffs and
# https://dikman.medium.com/optimising-flutter-ci-by-caching-packages-8a1d537e0b23
# Requires extending job to set DART_VERSION variable.
.use-pub-cache-bin:
before_script:
- export PUB_CACHE="$CI_PROJECT_DIR/.pub-cache" # https://dart.dev/tools/pub/environment-variables
- export PATH="$PATH":"$PUB_CACHE/bin"
cache:
paths:
- $CI_PROJECT_DIR/.pub-cache/
.install-dependencies:
before_script:
- dart pub get
unit-test:
stage: test
extends:
- .use-pub-cache-bin
- .install-dependencies
script:
- dart test $PUB_VARS
interruptible: true
rules:
- if: $CI_COMMIT_REF_NAME
# don't run on tags
- if: $CI_COMMIT_TAG
when: never
lint-test:
stage: test
extends:
- .use-pub-cache-bin
- .install-dependencies
script:
- dart analyze .
interruptible: true
rules:
- if: $CI_COMMIT_REF_NAME
# don't run on tags
- if: $CI_COMMIT_TAG
when: never
format-test:
stage: test
extends:
- .use-pub-cache-bin
- .install-dependencies
script:
- dart format -l 120 --set-exit-if-changed bin/ lib/ test/
interruptible: true
rules:
- if: $CI_COMMIT_REF_NAME
# don't run on tags
- if: $CI_COMMIT_TAG
when: never