diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..1534747 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,40 @@ +version: 2.1 +jobs: + build: + working_directory: ~/AndroidSetup + docker: + - image: circleci/android:api-28 + environment: + GRADLE_OPTS: -Xmx4g -Dorg.gradle.daemon=false + JVM_OPTS: -Xmx4g + steps: + - checkout + - restore_cache: + key: gradle-{{ checksum "build.gradle.kts" }}-{{ checksum "buildSrc/src/main/kotlin/Config.kt" }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "app/build.gradle.kts" }} + - run: + name: Download Dependencies + command: ./gradlew androidDependencies + - save_cache: + paths: + - ~/.gradle + key: gradle-{{ checksum "build.gradle.kts" }}-{{ checksum "buildSrc/src/main/kotlin/Config.kt" }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "app/build.gradle.kts" }} + - run: + name: Run Detekt + command: ./gradlew detekt + - run: + name: Run Ktlint + command: ./gradlew ktlintCheck + - run: + name: Run UnitTest + command: ./gradlew testDebugUnitTest + - run: + name: Save UnitTest results + command: | + mkdir -p ~/test-results/junit/ + find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/junit/ \; + when: always + - store_test_results: + path: ~/test-results + - store_artifacts: + path: app/build/reports + destination: reports \ No newline at end of file