.drone.yml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. ---
  2. kind: pipeline
  3. type: docker
  4. name: tests-stable
  5. # SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  6. # SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
  7. steps:
  8. - name: gplay
  9. image: ghcr.io/nextcloud/continuous-integration-android8:4
  10. privileged: true
  11. environment:
  12. LOG_USERNAME:
  13. from_secret: LOG_USERNAME
  14. LOG_PASSWORD:
  15. from_secret: LOG_PASSWORD
  16. GIT_USERNAME:
  17. from_secret: GIT_USERNAME
  18. GITHUB_TOKEN:
  19. from_secret: GIT_TOKEN
  20. commands:
  21. - scripts/checkIfRunDrone.sh $DRONE_PULL_REQUEST || exit 0
  22. - emulator -avd android -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 &
  23. - sed -i s'#<bool name="is_beta">false</bool>#<bool name="is_beta">true</bool>#'g app/src/main/res/values/setup.xml
  24. - ./gradlew assembleGplayDebugAndroidTest
  25. - scripts/wait_for_emulator.sh
  26. - ./gradlew installGplayDebugAndroidTest
  27. - scripts/wait_for_server.sh "server"
  28. - scripts/deleteOldComments.sh "stable" "IT" $DRONE_PULL_REQUEST
  29. - ./gradlew createGplayDebugCoverageReport -Pcoverage -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.owncloud.android.utils.ScreenshotTest || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "IT" $DRONE_PULL_REQUEST
  30. services:
  31. - name: server
  32. image: ghcr.io/nextcloud/continuous-integration-shallow-server:latest # also change in updateScreenshots.sh
  33. environment:
  34. EVAL: true
  35. SERVER_VERSION: 'stable29'
  36. commands:
  37. - BRANCH="$SERVER_VERSION" /usr/local/bin/initnc.sh
  38. - echo 127.0.0.1 server >> /etc/hosts
  39. - apt-get update && apt-get install -y composer
  40. - su www-data -c "OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1"
  41. - su www-data -c "OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2"
  42. - su www-data -c "OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3"
  43. - su www-data -c "php /var/www/html/occ user:setting user2 files quota 1G"
  44. - su www-data -c "php /var/www/html/occ group:add users"
  45. - su www-data -c "php /var/www/html/occ group:adduser users user1"
  46. - su www-data -c "php /var/www/html/occ group:adduser users user2"
  47. - su www-data -c "git clone --depth 1 -b $SERVER_VERSION https://github.com/nextcloud/activity.git /var/www/html/apps/activity/"
  48. - su www-data -c "php /var/www/html/occ app:enable activity"
  49. - su www-data -c "git clone --depth 1 -b $SERVER_VERSION https://github.com/nextcloud/text.git /var/www/html/apps/text/"
  50. - su www-data -c "php /var/www/html/occ app:enable text"
  51. - su www-data -c "git clone --depth 1 -b $SERVER_VERSION https://github.com/nextcloud/end_to_end_encryption.git /var/www/html/apps/end_to_end_encryption/"
  52. - su www-data -c "php /var/www/html/occ app:enable end_to_end_encryption"
  53. - su www-data -c "git clone --depth 1 -b $SERVER_VERSION https://github.com/nextcloud/photos.git /var/www/html/apps/photos/"
  54. - su www-data -c "cd /var/www/html/apps/photos; composer install --no-dev"
  55. - su www-data -c "php /var/www/html/occ app:enable -f photos"
  56. - /usr/local/bin/run.sh
  57. trigger:
  58. branch:
  59. - master
  60. - stable-*
  61. event:
  62. - push
  63. - pull_request
  64. ---
  65. kind: pipeline
  66. type: docker
  67. name: tests-master
  68. steps:
  69. - name: gplay
  70. image: ghcr.io/nextcloud/continuous-integration-android8:3
  71. privileged: true
  72. environment:
  73. LOG_USERNAME:
  74. from_secret: LOG_USERNAME
  75. LOG_PASSWORD:
  76. from_secret: LOG_PASSWORD
  77. GIT_USERNAME:
  78. from_secret: GIT_USERNAME
  79. GITHUB_TOKEN:
  80. from_secret: GIT_TOKEN
  81. commands:
  82. - scripts/checkIfRunDrone.sh $DRONE_PULL_REQUEST || exit 0
  83. - emulator -avd android -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 &
  84. - sed -i s'#<bool name="is_beta">false</bool>#<bool name="is_beta">true</bool>#'g app/src/main/res/values/setup.xml
  85. - scripts/runCombinedTest.sh $DRONE_PULL_REQUEST $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER
  86. services:
  87. - name: server
  88. image: ghcr.io/nextcloud/continuous-integration-shallow-server:latest # also change in updateScreenshots.sh
  89. environment:
  90. EVAL: true
  91. commands:
  92. - /usr/local/bin/initnc.sh
  93. - echo 127.0.0.1 server >> /etc/hosts
  94. - apt-get update && apt-get install -y composer
  95. - su www-data -c "OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1"
  96. - su www-data -c "OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2"
  97. - su www-data -c "OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3"
  98. - su www-data -c "php /var/www/html/occ user:setting user2 files quota 1G"
  99. - su www-data -c "php /var/www/html/occ group:add users"
  100. - su www-data -c "php /var/www/html/occ group:adduser users user1"
  101. - su www-data -c "php /var/www/html/occ group:adduser users user2"
  102. - su www-data -c "git clone --depth 1 -b master https://github.com/nextcloud/activity.git /var/www/html/apps/activity/"
  103. - su www-data -c "php /var/www/html/occ app:enable activity"
  104. - su www-data -c "git clone --depth 1 -b main https://github.com/nextcloud/text.git /var/www/html/apps/text/"
  105. - su www-data -c "php /var/www/html/occ app:enable text"
  106. - su www-data -c "git clone --depth 1 -b master https://github.com/nextcloud/end_to_end_encryption/ /var/www/html/apps/end_to_end_encryption/"
  107. - su www-data -c "php /var/www/html/occ app:enable end_to_end_encryption"
  108. - su www-data -c "git clone --depth 1 https://github.com/nextcloud/photos.git /var/www/html/apps/photos/"
  109. - su www-data -c "cd /var/www/html/apps/photos; composer install --no-dev"
  110. - su www-data -c "php /var/www/html/occ app:enable -f photos"
  111. - /usr/local/bin/run.sh
  112. trigger:
  113. branch:
  114. - master
  115. - stable-*
  116. event:
  117. - push
  118. - pull_request
  119. ---
  120. kind: pipeline
  121. type: docker
  122. name: allScreenshots
  123. steps:
  124. - name: runAllScreenshots
  125. image: ghcr.io/nextcloud/continuous-integration-android8:4
  126. privileged: true
  127. environment:
  128. GIT_USERNAME:
  129. from_secret: GIT_USERNAME
  130. GITHUB_TOKEN:
  131. from_secret: GIT_TOKEN
  132. LOG_USERNAME:
  133. from_secret: LOG_USERNAME
  134. LOG_PASSWORD:
  135. from_secret: LOG_PASSWORD
  136. commands:
  137. - emulator -avd android -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 &
  138. - sed -i s'#<bool name="is_beta">false</bool>#<bool name="is_beta">true</bool>#'g app/src/main/res/values/setup.xml
  139. - sed -i s'#showOnlyFailingTestsInReports = ciBuild#showOnlyFailingTestsInReports = false#' build.gradle
  140. - scripts/wait_for_emulator.sh
  141. - scripts/runAllScreenshotCombinations noCI false
  142. - scripts/screenshotSummary.sh
  143. - name: notify
  144. image: drillster/drone-email
  145. settings:
  146. port: 587
  147. from: nextcloud-drone@kaminsky.me
  148. recipients_only: true
  149. username:
  150. from_secret: EMAIL_USERNAME
  151. password:
  152. from_secret: EMAIL_PASSWORD
  153. recipients:
  154. from_secret: EMAIL_RECIPIENTS
  155. host:
  156. from_secret: EMAIL_HOST
  157. when:
  158. event:
  159. - push
  160. status:
  161. - failure
  162. branch:
  163. - master
  164. - stable-*
  165. trigger:
  166. event:
  167. - cron
  168. cron:
  169. - allscreenshots
  170. ---
  171. kind: secret
  172. name: GIT_TOKEN
  173. data: XIoa9IYq+xQ+N5iln8dlpWv0jV6ROr7HuE24ioUr4uQ8m8SjyH0yognWYLYLqnbTKrFWlFZiEMQTH/sZiWjRFvV1iL0=
  174. ---
  175. kind: signature
  176. hmac: f0d3fa25f7f901e8b3deacec52db0d5a81f05f7d4f13af27c633ad712ecdbc4d
  177. ...