.drone.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. pipeline:
  2. test:
  3. image: nextcloudci/android:android-31
  4. commands:
  5. # uncomment gplay for Gplay, Modified only
  6. - sh -c "if [ '$FLAVOUR' != 'Generic' ]; then sed -i '/.*com.google.*/s/^.*\\/\\///g' build.gradle; fi"
  7. # - echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI -c 20M
  8. # - emulator -avd test -no-window &
  9. # - ./wait_for_emulator.sh
  10. # build app and assemble APK, in debug mode
  11. - sh -c "if [ '$FLAVOUR' != 'Lint' ]; then ./gradlew assemble${FLAVOUR}; fi"
  12. # run all the instrumented tests of app module - DISABLED until we get an stable setup for Espresso in Travis
  13. # - ./gradlew connectedDebugAndroidTest --info
  14. # install app, then assemble and install instrumented tests of app module
  15. # - ./gradlew :install${FLAVOUR}Debug
  16. # - ./gradlew :install${FLAVOUR}DebugAndroidTest
  17. # run sample instrumented unit test
  18. # TODO fails because test runner is not available
  19. #- adb shell am instrument -w -e debug false -e class com.owncloud.android.datamodel.OCFileUnitTest com.owncloud.android.test/android.support.test.runner.AndroidJUnitRunner
  20. environment:
  21. - ANDROID_TARGET=android-24
  22. - ANDROID_ABI=armeabi-v7a
  23. - LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:/opt/android-sdk-linux/tools/lib64/gles_mesa/
  24. lint:
  25. image: nextcloudci/android:android-31
  26. commands:
  27. # needs gplay
  28. - sed -i '/.*com.google.*/s/^.*\\/\\///g' build.gradle
  29. - export BRANCH=$(scripts/lint/getBranchName.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST)
  30. - scripts/lint/lint-up-wrapper.sh $GIT_USERNAME $GIT_TOKEN $BRANCH $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER
  31. secrets: [ GIT_USERNAME, GIT_TOKEN, LOG_USERNAME, LOG_PASSWORD ]
  32. when:
  33. matrix:
  34. FLAVOUR: Lint
  35. notify:
  36. image: drillster/drone-email
  37. host: $EMAIL_HOST
  38. port: 587
  39. username: $EMAIL_USERNAME
  40. password: $EMAIL_PASSWORD
  41. from: nextcloud-drone@kaminsky.me
  42. recipients_only: true
  43. recipients: [ $EMAIL_RECIPIENTS ]
  44. secrets: [ EMAIL_USERNAME, EMAIL_PASSWORD, EMAIL_RECIPIENTS, EMAIL_HOST ]
  45. when:
  46. event: push
  47. status: failure
  48. branch: master
  49. matrix:
  50. FLAVOUR:
  51. - Generic
  52. - Gplay
  53. - Modified
  54. - Lint
  55. branches: master