aboutsummaryrefslogtreecommitdiff
path: root/circle.yml
blob: 012f6cfd56ea817f617cbbf962f6da428b12e849 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
version: 2
jobs:
  build:
    working_directory: ~/code
    docker:
      - image: circleci/android:api-26-alpha
    resource_class: xlarge
    environment:
      JVM_OPTS: -Xmx3172m
      GRADLE_MAX_PARALLEL_FORKS: 2
    steps:
      - checkout
      - run:
          name: Calculate Cache Hash
          command: |
            find . \( -name \*.gradle -or -name \*.groovy -or -name \*.sh -or -name \*.rb -or -name circle.yml \) -exec shasum {} \; | sort > .cache-hash
            cat .cache-hash
      - run:
          name: Install Maven
          command: sudo apt-get update; sudo apt-get install maven
      - restore_cache:
          key: cache-{{ checksum ".cache-hash" }}
      - run:
          name: Download Dependencies
          command: |
            sdkmanager --install 'platforms;android-27'
            ./scripts/install-dependencies.rb
            ./gradlew prefetchDependencies
      - save_cache:
          paths:
            - ~/.gradle
            - ~/.m2
            - /opt/android/sdk/platforms/android-27
          key: cache-{{ checksum ".cache-hash" }}
      - run:
          name: Build and Test
          command: SKIP_JAVADOC=true ./gradlew clean assemble test --info --stacktrace --continue
      - run:
          name: Collect Test Results
          command: |
            mkdir -p ~/junit/
            find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/junit/ \;
          when: always
      - store_test_results:
          path: ~/junit
      - store_artifacts:
          path: build/reports
          destination: reports
      - run:
          name: Upload Snapshot
          command: |
            if [ "${CIRCLE_BRANCH}" == "master" ]; then
              ./gradlew upload --no-rebuild
            fi