config.yml 7.09 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
version: 2
jobs:
  build:
    working_directory: ~/flyve_mdm
    docker:
      # Android the primary container
      - image: circleci/android:api-26-alpha
    environment:
      JVM_OPTS: -Xmx3200m
    steps:
      - checkout
      - restore_cache:
          key: jars-{{ checksum "build.gradle" }}-{{ checksum  "glpi/build.gradle" }}
14
15
16
      - run:
          name: Setup gradle properties
          command: source ci/scripts/ci_gradle_properties.sh
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
      - run:
          name: Build
          command: ./gradlew build
      - save_cache:
          paths:
            - ~/.gradle
          key: jars-{{ checksum "build.gradle" }}-{{ checksum  "glpi/build.gradle" }}
  test_api_v25:
    working_directory: ~/flyve_mdm
    docker:
        - image: circleci/android:api-26-alpha
    environment:
      JVM_OPTS: -Xmx3200m
    steps:
      - checkout
32
33
34
      - run:
          name: Setup gradle properties
          command: source ci/scripts/ci_gradle_properties.sh
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
      - run:
          name: Setup emulator
          command: sdkmanager "system-images;android-25;google_apis;armeabi-v7a" && echo "no" | avdmanager create avd -n test -k "system-images;android-25;google_apis;armeabi-v7a"
      - run:
          name: Launch emulator
          command: export LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib && emulator64-arm -avd test -noaudio -no-boot-anim -no-window -accel on
          background: true
      - run:
          name: Wait emulator
          command: |
            # wait for it to have booted
            circle-android wait-for-boot
            # unlock the emulator screen
            sleep 30
            adb shell input keyevent 82
      - run:
          name: Run Tests
          command: ./gradlew connectedAndroidTest
      - store_artifacts:
          path: glpi/build/reports
          destination: reports
      - store_test_results:
          path: glpi/build/test-results
  test_api_v16:
      working_directory: ~/flyve_mdm
      docker:
          - image: circleci/android:api-26-alpha
      environment:
        JVM_OPTS: -Xmx3200m
      steps:
        - checkout
66
67
68
        - run:
            name: Setup gradle properties
            command: source ci/scripts/ci_gradle_properties.sh
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
        - run:
            name: Setup emulator
            command: sdkmanager "system-images;android-16;default;armeabi-v7a" && echo "no" | avdmanager create avd -n test -k "system-images;android-16;default;armeabi-v7a"
        - run:
            name: Launch emulator
            command: export LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib && emulator64-arm -avd test -noaudio -no-boot-anim -no-window -accel on
            background: true
        - run:
            name: Wait emulator
            command: |
              # wait for it to have booted
              circle-android wait-for-boot
              # unlock the emulator screen
              sleep 30
              adb shell input keyevent 82
        - run:
            name: Run Tests
            command: ./gradlew connectedAndroidTest
        - store_artifacts:
            path: glpi/build/reports
            destination: reports
        - store_test_results:
            path: glpi/build/test-results
  deploy_production:
      working_directory: ~/flyve_mdm
      docker:
        # Android the primary container
        - image: circleci/android:api-26-alpha
      environment:
        JVM_OPTS: -Xmx3200m
      steps:
        - checkout
        - restore_cache:
            key: jars-{{ checksum "build.gradle" }}-{{ checksum  "glpi/build.gradle" }}
103
104
105
        - run:
            name: Setup gradle properties
            command: source ci/scripts/ci_gradle_properties.sh
106
107
108
109
110
111
112
113
114
115
116
117
        - run:
            name: Validate
            command: source ci/scripts/ci_validate_workflow.sh
        - run:
            name: Setup environment
            command: source ci/scripts/ci_setup.sh
        - run:
            name: Update version and code
            command: source ci/scripts/ci_updateversion.sh
        - run:
            name: Push changes to github
            command: source ci/scripts/ci_push_changes.sh
118
119
120
        - run:
            name: Create apk
            command: source ci/scripts/ci_fastlane.sh "example"
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
        - run:
            name: Create a github release
            command: source ci/scripts/ci_github_release.sh
        - run:
            name: Deploy to Bintray
            command: source ci/scripts/ci_bintray.sh
        - save_cache:
            paths:
              - ~/.gradle
            key: jars-{{ checksum "build.gradle" }}-{{ checksum  "glpi/build.gradle" }}
  documentation:
      working_directory: ~/flyve_mdm
      docker:
        # Android the primary container
        - image: circleci/android:api-26-alpha
      environment:
        JVM_OPTS: -Xmx3200m
      steps:
        - checkout
        - restore_cache:
            key: jars-{{ checksum "build.gradle" }}-{{ checksum  "glpi/build.gradle" }}
142
143
144
        - run:
            name: Setup gradle properties
            command: source ci/scripts/ci_gradle_properties.sh
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
        - run:
            name: Setup environment
            command: source ci/scripts/ci_setup.sh
        - run:
            name: Update version and code
            command: source ci/scripts/ci_updateversion.sh
        - run:
            name: Setup emulator
            command: sdkmanager "system-images;android-16;default;armeabi-v7a" && echo "no" | avdmanager create avd -n test -k "system-images;android-16;default;armeabi-v7a"
        - run:
            name: Launch emulator
            command: export LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib && emulator64-arm -avd test -noaudio -no-boot-anim -no-window -accel on
            background: true
        - run:
            name: Wait emulator
            command: |
              # wait for it to have booted
              circle-android wait-for-boot
              # unlock the emulator screen
              sleep 30
              adb shell input keyevent 82
        - run:
            name: Send changelog to gh-page
            command: source ci/scripts/ci_changelog.sh
        - run:
            name: Coverage
            command: source ci/scripts/ci_coverage.sh
        - run:
            name: Javadoc
            command: source ci/scripts/ci_javadoc.sh
        - save_cache:
            paths:
              - ~/.gradle
            key: jars-{{ checksum "build.gradle" }}-{{ checksum  "glpi/build.gradle" }}

workflows:
  version: 2
  build_test_and_deploy:
    jobs:
      - build
      - test_api_v16:
          requires:
            - build
          filters:
            branches:
              only:
                - develop
      - test_api_v25:
          requires:
            - build
          filters:
            branches:
              only:
                - develop
      - documentation:
          requires:
            - test_api_v16
            - test_api_v25
          filters:
            branches:
              only:
                - develop
      - deploy_production:
          requires:
            - build
          filters:
            branches:
              only:
                - master