.drone.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. pipeline:
  2. compile:
  3. image: nextcloudci/android:android-35
  4. commands:
  5. # uncomment gplay for Gplay
  6. - sh -c "if [ '${FLAVOR}' = 'Gplay' ]; then sed -i '/.*com.google.*/s/^.*\\/\\///g' build.gradle; fi"
  7. # build app and assemble APK
  8. - sh -c "if [ '${FLAVOR}' != 'Analysis' ]; then ./gradlew assemble${FLAVOR}; fi"
  9. when:
  10. matrix:
  11. FLAVOR: [Generic, Gplay]
  12. test:
  13. image: nextcloudci/android:android-35
  14. privileged: true
  15. commands:
  16. - emulator -avd android-27 -no-window -no-audio &
  17. - ./wait_for_emulator.sh
  18. - ./gradlew assembleGplayDebug
  19. - ./gradlew jacocoTestGplayDebugUnitTestReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "Unit"
  20. - ./gradlew installGplayDebugAndroidTest
  21. - ./gradlew createGplayDebugCoverageReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "IT"
  22. - ./gradlew combinedTestReport
  23. - curl -o codecov.sh https://codecov.io/bash
  24. - bash ./codecov.sh -t fc506ba4-33c3-43e4-a760-aada38c24fd5
  25. secrets: [ LOG_USERNAME, LOG_PASSWORD ]
  26. when:
  27. matrix:
  28. FLAVOR: Gplay
  29. analysis:
  30. image: nextcloudci/android:android-37
  31. commands:
  32. # needs gplay
  33. - sed -i '/.*com.google.*/s/^.*\\/\\///g' build.gradle
  34. - export BRANCH=$(scripts/analysis/getBranchName.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST)
  35. - scripts/analysis/analysis-wrapper.sh $GIT_USERNAME $GIT_TOKEN $BRANCH $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER $DRONE_PULL_REQUEST
  36. secrets: [ GIT_USERNAME, GIT_TOKEN, LOG_USERNAME, LOG_PASSWORD ]
  37. when:
  38. matrix:
  39. FLAVOR: Analysis
  40. notify:
  41. image: drillster/drone-email
  42. host: $EMAIL_HOST
  43. port: 587
  44. username: $EMAIL_USERNAME
  45. password: $EMAIL_PASSWORD
  46. from: nextcloud-drone@kaminsky.me
  47. recipients_only: true
  48. recipients: [ $EMAIL_RECIPIENTS ]
  49. secrets: [ EMAIL_USERNAME, EMAIL_PASSWORD, EMAIL_RECIPIENTS, EMAIL_HOST ]
  50. when:
  51. event: push
  52. status: failure
  53. branch: master
  54. matrix:
  55. FLAVOR:
  56. - Generic
  57. - Gplay
  58. - Analysis
  59. services:
  60. server:
  61. image: nextcloudci/server:server-1
  62. when:
  63. matrix:
  64. FLAVOR: Gplay
  65. branches: master