-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
89 lines (84 loc) · 1.79 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
# Common
default:
cache: &flutter_cache
paths:
- .dart_tool
- ./**/.dart_tool
- .flutter-plugins
- ./**/.flutter-plugins
- .flutter-plugins-dependencies
- ./**/.flutter-plugins-dependencies
.build_flutter:
before_script:
- sh scripts/ci/validate_environment.sh
- dart run melos bootstrap
# Unit tests
unit_tests:
extends: .build_flutter
stage: test
tags:
- mobile
only:
- merge_requests
- develop
- master
script:
- sh scripts/ci/run_tests.sh
# UI tests
ui_tests:
extends: .build_flutter
stage: test
tags:
- mobile
only:
- merge_requests
- develop
- master
cache:
<<: *flutter_cache
paths:
- apps/app_main/ui_tests/node_modules
- apps/app_main/ui_tests/venv
- ios/Pods
script:
- sh apps/app_main/ui_tests/scripts/setup.sh
- sh scripts/ci/build_ios_simulator.sh
- sh apps/app_main/ui_tests/scripts/run_ios.sh
after_script:
- sh apps/app_main/ui_tests/scripts/stop_ios.sh
# Android
build_android:
extends: .build_flutter
stage: build
tags:
- mobile
only:
- merge_requests
- develop
- master
cache:
key: android_cache
<<: *flutter_cache
paths:
- android/.gradle
artifacts:
paths:
- build/app/outputs/flutter-apk/app-release.apk
script:
sh scripts/ci/build_android_apk.sh
deploy_to_stage_android:
stage: deploy
tags:
- mobile
needs:
- unit_tests
- build_android
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == "develop"'
when: on_success
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"'
when: manual
allow_failure: true
cache: []
script:
- sh scripts/ci/deploy_android_firebase.sh