Migrate to CircleCI 2.0
Summary:
Just trying this out to see if it works.
Closes
-machine:
+version: 2
+jobs:
+ build:
+ working_directory: ~/fresco
+ docker:
+ - image: circleci/android:api-27-alpha
environment:
- PATH: $ANDROID_NDK:$PATH
- GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
- java:
- version: oraclejdk8
-
-dependencies:
- pre:
- # if necessary SDK / build tools / support library folders do not exist, update the circle ci instance accordingly
- - if [ ! -d "/usr/local/android-sdk-linux/platforms/android-26" ]; then echo y | android update sdk --no-ui --all --filter "android-26"; fi
- - if [ ! -d "/usr/local/android-sdk-linux/build-tools/26.0.0" ]; then echo y | android update sdk --no-ui --all --filter "build-tools-27.0.2"; fi
- - if [ ! -d "/usr/local/android_sdk/extras/android/m2repository/com/android/support/support-core-utils/25.1.0" ]; then echo y | android update sdk --no-ui --all --filter "extra-android-m2repository"; fi
- # setup NDK r15b
- - if [ ! -d "/home/ubuntu/android-ndk-r15b" ]; then wget https://dl.google.com/android/repository/android-ndk-r15b-linux-x86_64.zip; unzip android-ndk-r15b-linux-x86_64.zip -d "/home/ubuntu"; fi
- - echo "ndk.dir=/home/ubuntu/android-ndk-r15b" >> "/home/ubuntu/fresco/local.properties"
-
-test:
- override:
- - ./gradlew test assembleDebug -PdisablePreDex
- post:
- # copy test report for Circle CI to display
- - mkdir -p $CIRCLE_TEST_REPORTS/junit/
- - find . -type f -regex ".*/build/test-results/debug/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
+ JVM_OPTS: -Xmx3200m
+ steps:
+ - checkout
+ - run:
+ name: Setup NDK
+ command: |
+ wget --quiet https://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip
+ unzip -q android-ndk-r15c-linux-x86_64.zip -d /home/circleci
+ echo "ndk.dir=/home/circleci/android-ndk-r15c" >> /home/circleci/fresco/local.properties
+ - run:
+ name: "NDK Fix: https://github.com/android-ndk/ndk/issues/188"
+ command: sudo apt-get install file
+ - run:
+ name: Run Tests
+ command: ./gradlew test assembleDebug -PdisablePreDex
+ - run:
+ name: Copy Results
+ command: |
+ mkdir -p /home/circleci/test-results/junit
+ find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} /home/circleci/test-results/junit \;
+ - test-results-store:
+ path: /home/circleci/test-results
