config.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. version: 2
  2. jobs:
  3. build:
  4. branches:
  5. only:
  6. - master
  7. working_directory: ~/code
  8. docker:
  9. - image: circleci/android:api-29
  10. environment:
  11. JVM_OPTS: -Xmx3200m
  12. steps:
  13. - checkout
  14. - restore_cache:
  15. key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
  16. - run:
  17. name: Chmod permissions #if permission for Gradlew Dependencies fail, use this.
  18. command: sudo chmod +x ./gradlew
  19. - run:
  20. name: Run build
  21. command: export TERM=${TERM:-dumb} && ./gradlew clean build
  22. - run: echo $ENCODED_KEYSTORE | base64 --decode --ignore-garbage >> ${HOME}/keystore.jks
  23. - run: echo ‘export KEYSTORE=${HOME}/keystore.jks’ >> $BASH_ENV
  24. - run:
  25. name: Download Dependencies
  26. command: ./gradlew androidDependencies
  27. - save_cache:
  28. paths:
  29. - ~/.gradle
  30. key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
  31. - run:
  32. name: Run Tests
  33. command: ./gradlew lint test
  34. - store_artifacts:
  35. path: app/build/reports
  36. destination: reports
  37. - store_test_results:
  38. path: app/build/test-results
  39. # See https://circleci.com/docs/2.0/deployment-integrations/ for deploy examples