.drone.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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}' != 'Lint' ]; 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 jacocoTestGplayDebugUnitTestReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "Unit"
  19. - ./gradlew assembleGplayDebug installGplayDebugAndroidTest
  20. - ./gradlew createGplayDebugCoverageReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "IT"
  21. - ./gradlew combinedTestReport
  22. - curl -o codecov.sh https://codecov.io/bash
  23. - bash ./codecov.sh -t fc506ba4-33c3-43e4-a760-aada38c24fd5
  24. secrets: [ LOG_USERNAME, LOG_PASSWORD ]
  25. when:
  26. matrix:
  27. FLAVOR: Gplay
  28. lint:
  29. image: nextcloudci/android:android-35
  30. commands:
  31. # needs gplay
  32. - sed -i '/.*com.google.*/s/^.*\\/\\///g' build.gradle
  33. - export BRANCH=$(scripts/lint/getBranchName.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST)
  34. - scripts/lint/lint-up-wrapper.sh $GIT_USERNAME $GIT_TOKEN $BRANCH $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER
  35. secrets: [ GIT_USERNAME, GIT_TOKEN, LOG_USERNAME, LOG_PASSWORD ]
  36. when:
  37. matrix:
  38. FLAVOR: Lint
  39. notify:
  40. image: drillster/drone-email
  41. host: $EMAIL_HOST
  42. port: 587
  43. username: $EMAIL_USERNAME
  44. password: $EMAIL_PASSWORD
  45. from: nextcloud-drone@kaminsky.me
  46. recipients_only: true
  47. recipients: [ $EMAIL_RECIPIENTS ]
  48. secrets: [ EMAIL_USERNAME, EMAIL_PASSWORD, EMAIL_RECIPIENTS, EMAIL_HOST ]
  49. when:
  50. event: push
  51. status: failure
  52. branch: master
  53. matrix:
  54. FLAVOR:
  55. - Generic
  56. - Gplay
  57. - Lint
  58. services:
  59. server:
  60. image: nextcloudci/server:server-1
  61. when:
  62. matrix:
  63. FLAVOR: Gplay
  64. branches: master