.drone.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. pipeline:
  2. compile:
  3. image: nextcloudci/android:android-44
  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-44
  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" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
  18. - ./gradlew installGplayDebugAndroidTest
  19. - ./gradlew createGplayDebugCoverageReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
  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, GIT_USERNAME, GIT_TOKEN ]
  24. when:
  25. matrix:
  26. FLAVOR: Gplay
  27. analysis:
  28. image: nextcloudci/android:android-44
  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. skip_verify: true
  44. recipients_only: true
  45. recipients: [ $EMAIL_RECIPIENTS ]
  46. secrets: [ EMAIL_USERNAME, EMAIL_PASSWORD, EMAIL_RECIPIENTS, EMAIL_HOST ]
  47. when:
  48. event: push
  49. status: failure
  50. branch: master
  51. matrix:
  52. FLAVOR:
  53. - Generic
  54. - Gplay
  55. - Analysis
  56. services:
  57. server:
  58. image: nextcloudci/server:server-3
  59. when:
  60. matrix:
  61. FLAVOR: Gplay
  62. branches: master