@@ -2,49 +2,43 @@ version: 2.1
2
2
executors :
3
3
flutter_executor :
4
4
docker :
5
- - image : cirrusci/flutter:2.10.5
5
+ - image : cirrusci/flutter:stable
6
6
environment :
7
- _JAVA_OPTIONS : " -XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport "
7
+ _JAVA_OPTIONS : " -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap "
8
8
9
9
commands :
10
10
prepare_enviroment :
11
11
description : Fetch the repo, do flutter doctor and install deps
12
12
steps :
13
13
- add_ssh_keys :
14
14
fingerprints :
15
- - 85:5e:13:f8:60:b2:55:a1:df:d1:8e:77:17:4c:3b:2d
15
+ - 26:72:b1:08:0f:c1:3b:2b:2d:ea:61:7d:d6:11:63:fb
16
16
- checkout
17
17
- run :
18
18
name : Run Flutter doctor
19
19
command : flutter doctor
20
20
- restore_cache :
21
21
keys :
22
- - android-sdk-licenses
23
- - gradle
24
- - pub-cache
25
- - bin
22
+ - android-sdk-licenses
23
+ - gradle
24
+ - pub-cache
25
+ - bin
26
26
- run :
27
27
name : pub get
28
28
command : flutter pub get
29
29
30
- analyze_code :
31
- description : Do flutter analyze
32
- steps :
33
- - run :
34
- name : Code analysis
35
- command : flutter analyze --no-pub
36
-
37
30
code_coverage :
38
31
description : Do prebuild stuff
39
32
steps :
40
33
- run :
41
34
name : Run the application tests
42
35
command : flutter test --coverage
36
+
43
37
- run :
44
38
name : Upload coverage
45
39
command : |
46
- sudo gem install coveralls-lcov
47
- coveralls-lcov -t $COVERALLS_REPO_TOKEN coverage/lcov.info
40
+ sudo gem install coveralls-lcov
41
+ coveralls-lcov -t $COVERALLS_REPO_TOKEN coverage/lcov.info
48
42
49
43
build_app :
50
44
description : Build the app
@@ -68,38 +62,37 @@ commands:
68
62
- run :
69
63
name : Check that we can build for all Android platforms
70
64
command : |
71
- flutter build -v << parameters.file_type >> << parameters.buildNumber >> --<< parameters.mode >> << parameters.target >>
65
+ flutter build -v << parameters.file_type >> << parameters.buildNumber >> --<< parameters.mode >> << parameters.target >>
72
66
working_directory : <<parameters.working_directory>>
73
67
74
68
save_env_cache :
75
- description : Save the caches
69
+ description : Save the caches
76
70
steps :
77
71
- save_cache :
78
72
key : android-sdk-licenses
79
73
paths :
80
- - /opt/android-sdk-linux/licenses
74
+ - /opt/android-sdk-linux/licenses
81
75
82
76
- save_cache :
83
77
key : pub-cache
84
78
paths :
85
- - /home/cirrus/.pub-cache
79
+ - /home/cirrus/.pub-cache
86
80
87
81
- save_cache :
88
82
key : gradle
89
83
paths :
90
- - ~/.gradle
84
+ - ~/.gradle
91
85
92
86
- save_cache :
93
87
key : bin
94
88
paths :
95
- - /usr/local/bin
89
+ - /usr/local/bin
96
90
97
91
jobs :
98
92
build_pr :
99
93
executor : flutter_executor
100
94
steps :
101
95
- prepare_enviroment
102
- - analyze_code
103
96
- code_coverage
104
97
- build_app :
105
98
target : " --target-platform android-arm,android-arm64,android-x86,android-x64"
@@ -108,25 +101,25 @@ jobs:
108
101
- run :
109
102
name : Copy APK
110
103
command : |
111
- sudo mkdir -p /artifacts && sudo chown "$(whoami)" /artifacts && cp build/app/outputs/flutter- apk/app-debug .apk /artifacts/deriv-chart .apk
104
+ sudo mkdir -p /artifacts && sudo chown "$(whoami)" /artifacts && cp build/app/outputs/apk/app.apk /artifacts/p2p-cashier .apk
112
105
working_directory : ~/project/example
113
106
114
107
- store_artifacts :
115
108
path : /artifacts
116
- # - run:
117
- # name: Upload to Slack
118
- # command: |
119
- # export GIT_COMMIT_DESC=$(git log --format=oneline -n 1 | sed -E 's/^[^ ]+ (.*)$/\1/g')
120
- # echo $CIRCLE_BUILD_URL
121
- # # If we wanted to upload the APK rather than providing a link, we can do that via
122
- # # something like this, but it requires an API token:
123
- # # curl -F file=@/artifacts/otc-cashier.apk -F channels=$SLACK_CHANNEL -F token=$SLACK_API_TOKEN -F title="${CIRCLE_PROJECT_REPONAME} | branch -> ${CIRCLE_BRANCH} | commit -> ${GIT_COMMIT_DESC}" https://slack.com/api/files.upload
124
- # # See https://medium.com/major-league/delivering-builds-through-slack-with-circle-ci-3d9e685e08f2 for an example
125
- # if [ "$CIRCLE_BRANCH" = "master" ]; then
126
- # # That 221348483 magic number is the internal CircleCI repository ID.
127
- # # Since it's not easily accessible from the environment or API, it's hardcoded for now.
128
- # curl -X POST --data-urlencode "payload={\"channel\": \"#mobile_flutter_chart \", \"username\": \"CircleCI\", \"text\": \"Latest Android build for Deriv Chart :\\nhttps://${CIRCLE_BUILD_NUM}-221348483-gh.circle-artifacts.com/0/artifacts/deriv-chart .apk\\n> $GIT_COMMIT_DESC\", \"icon_emoji\": \":autobot:\"}" $SLACK_URL
129
- # fi
109
+ - run :
110
+ name : Upload to Slack
111
+ command : |
112
+ export GIT_COMMIT_DESC=$(git log --format=oneline -n 1 | sed -E 's/^[^ ]+ (.*)$/\1/g')
113
+ echo $CIRCLE_BUILD_URL
114
+ # If we wanted to upload the APK rather than providing a link, we can do that via
115
+ # something like this, but it requires an API token:
116
+ # curl -F file=@/artifacts/otc-cashier.apk -F channels=$SLACK_CHANNEL -F token=$SLACK_API_TOKEN -F title="${CIRCLE_PROJECT_REPONAME} | branch -> ${CIRCLE_BRANCH} | commit -> ${GIT_COMMIT_DESC}" https://slack.com/api/files.upload
117
+ # See https://medium.com/major-league/delivering-builds-through-slack-with-circle-ci-3d9e685e08f2 for an example
118
+ if [ "$CIRCLE_BRANCH" = "master" ]; then
119
+ # That 221348483 magic number is the internal CircleCI repository ID.
120
+ # Since it's not easily accessible from the environment or API, it's hardcoded for now.
121
+ curl -X POST --data-urlencode "payload={\"channel\": \"#project_p2p_cashier \", \"username\": \"CircleCI\", \"text\": \"Latest Android build for P2P cashier :\\nhttps://${CIRCLE_BUILD_NUM}-221348483-gh.circle-artifacts.com/0/artifacts/p2p-cashier .apk\\n> $GIT_COMMIT_DESC\", \"icon_emoji\": \":autobot:\"}" $SLACK_URL
122
+ fi
130
123
- save_env_cache
131
124
132
125
workflows :
0 commit comments