Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
version: 2
references:

cache_key: &cache_key
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}

restore_cache: &restore_cache
restore_cache:
<<: *cache_key

save_cache: &save_cache
save_cache:
<<: *cache_key
paths:
~/.gradle

workspace: &workspace
~/workspace

attach_release_workspace: &attach_release_workspace
attach_workspace:
at: *workspace

persist_release_workspace: &persist_release_workspace
persist_to_workspace:
root: *workspace
paths:
- app/build

android_config: &android_config
working_directory: *workspace
docker:
- image: circleci/android:api-28-alpha
environment:
TERM: dumb
JAVA_OPTIONS: "-Xmx2048m"
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m"'

jobs:
build:
<<: *android_config
steps:
- checkout
- *restore_cache
- run:
name: Chmod permissions
command: sudo chmod +x ./gradlew
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
- *save_cache
- *persist_release_workspace

detekt:
<<: *android_config
steps:
- checkout
- *attach_release_workspace
- *restore_cache
- run:
name: Chmod permissions
command: sudo chmod +x ./gradlew
- run:
name: Run Detekt Checkstyle
command: ./gradlew detekt
- store_artifacts:
path: app/build/reports/
destination: /reports/

test_unit:
<<: *android_config
steps:
- checkout
- *attach_release_workspace
- *restore_cache
- run:
name: Chmod permissions
command: sudo chmod +x ./gradlew
- run:
name: Run unit tests
command: ./gradlew test -no-daemon -Pkotlin.incremental=false --max-workers=2
- store_artifacts:
path: app/build/reports/
destination: /reports/
- store_test_results:
path: app/build/test-results/
destination: /test-results/

workflows:
version: 2
workflow:
jobs:
- build:
filters:
tags:
only: /^.*/
- detekt:
requires:
- build
filters:
tags:
only: /^.*/
- test_unit:
requires:
- build
filters:
tags:
only: /^.*/
16 changes: 16 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
detekt {
version = "1.0.0-RC14"
input = files("${project.rootDir}/${project.getName()}/src/main/kotlin")
config = files("${project.rootDir}/detekt/detekt-config.yml")
filters = ".*test.*,.*/resources/.*,.*/tmp/.*"
reports {
xml {
enabled = true
destination = file("build/reports/detekt.xml")
}
html {
enabled = true
destination = file("build/reports/detekt.html")
}
}
}
}

dependencies {
Expand Down
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ buildscript {
}
}

plugins {
id("io.gitlab.arturbosch.detekt").version("1.0.0-RC14")
}

detekt {
toolVersion = "1.0.0-RC14"
input = files("src/main/java")
filters = ".*/resources/.*,.*/build/.*"
baseline = file("my-detekt-baseline.xml") // Just if you want to create a baseline file.
}

allprojects {
repositories {
google()
Expand Down
Loading