-
Notifications
You must be signed in to change notification settings - Fork 0
/
codemagic.yaml
135 lines (126 loc) · 3.99 KB
/
codemagic.yaml
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
123
124
125
126
127
128
129
130
131
132
133
134
135
workflows:
endet_one_app_ci:
name: EDNetOne CI
cache:
cache_paths:
- "$HOME/Library/Caches/CocoaPods\t"
- "$HOME/.gradle/caches\t"
- "$FLUTTER_ROOT/.pub-cache\t"
instance_type: mac_mini_m1
# Setting the timeout for a build to 15 minutes.
max_build_duration: 15
environment:
# Using the latest Flutter version.
flutter: stable
when:
changeset:
includes:
# Only run the CI when a file in one of the following directories
# changed.
- "apps/**"
- "codemagic.yaml"
excludes:
# Don't run the CI when only .md files changed.
- "**/*.md"
# This workflow should trigger when a new pull request opens or updates.
triggering:
branch_patterns:
- pattern: 'main'
include: true
source: false
events:
- pull_request
cancel_previous_builds: true
scripts:
- name: Add Dart SDK to PATH
script: |
echo PATH="$PATH":"$FLUTTER_ROOT/.pub-cache/bin" >> $CM_ENV
echo PATH="$PATH":"$FLUTTER_ROOT/bin" >> $CM_ENV
- name: Melos Bootstrap
script: |
dart pub global activate melos
melos bootstrap
- name: Run Analyze
script: melos run analyze
- name: Run Format
script: melos run format
- name: Run Tests
script: |
melos run test:flutter
# Upload results of failed golden tests if test command failed.
if [ $? -ne 0 ]; then
# Finds all "failures" folders and copies them to the export
# directory. Therefore, we are able to view the results of the
# failed golden tests.
#
# The command will use the exit code 0 (success) even when there are
# no failures folders.
find * -path '**/failures' -execdir bash -c "cp -r failures $FCI_EXPORT_DIR" \;
# Because we caught the exit code of the test command, we need to
# set manually again.
exit 1
fi
# endet_cms_pub_ci:
# name: EDNetCMS Pub CI
# instance_type: mac_mini_m1
# # Setting the timeout for a build to 15 minutes.
# max_build_duration: 15
# environment:
# # Using the latest Flutter version.
# flutter: stable
# groups:
# - ednet_dev
#
# # This workflow should trigger when a new pull request opens or updates.
# triggering:
# events:
# - pull_request
# branch_patterns:
# - pattern: 'main'
# include: true
# source: false
#
# cancel_previous_builds: true
#
# when:
# changeset:
# includes:
# # Only run the CI when a file in one of the following directories
# # changed.
# - "packages/**"
# - "codemagic.yaml"
# excludes:
# # Don't run the CI when only .md files changed.
# - "**/*.md"
# scripts:
# - name: Add Dart SDK to PATH
# script: |
# echo PATH="$PATH":"$FLUTTER_ROOT/.pub-cache/bin" >> $CM_ENV
# echo PATH="$PATH":"$FLUTTER_ROOT/bin" >> $CM_ENV
#
# - name: Melos Bootstrap
# script: |
# dart pub global activate melos
# melos bootstrap
#
# #- name: Run Analyze
# # script: melos run analyze
#
# # - name: Run Format
# # script: melos run format
# #
# # - name: Run Tests
# # script: melos run test:dart
#
# - name: Publish to pub.dev
# script: |
# mkdir $XDG_CONFIG_HOME/dart/
# echo $PUB_DEV_CREDENTIALS > "$XDG_CONFIG_HOME/dart/pub-credentials.json"
# melos run publish_cms_to_pub_dry
# echo "LOG after dry: HOME/.config/dart/pub-credentials.json"
# cat $XDG_CONFIG_HOME/dart/pub-credentials.json
# echo "ls HOME/.config/dart"
# ls $XDG_CONFIG_HOME/dart
# echo "XDG_CONFIG_HOME"
# echo "$XDG_CONFIG_HOME"
# melos run publish_cms_to_pub