.drone.yml 2.0 KB

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