Created
December 20, 2018 21:14
-
-
Save kaeawc/61a272fae47422741797b5b4c4084131 to your computer and use it in GitHub Desktop.
Making Circle CI not suck
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
mkdir -p /opt/android/sdk/licenses || true | |
cp ./licenses/* /opt/android/sdk/licenses/ | |
yes | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;28.0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults: &defaults | |
resource_class: xlarge | |
working_directory: ~/code | |
docker: | |
- image: circleci/android:api-28-alpha | |
environment: | |
TERM: dumb | |
TEST_FLAGS: " --stacktrace --configure-on-demand -PdisablePreDex" | |
_JAVA_OPTIONS: "-Xmx8192m -XX:ParallelGCThreads=4 -XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 -Djava.util.concurrent.ForkJoinPool.common.parallelism=4" | |
version: 2 | |
jobs: | |
build: | |
<<: *defaults | |
steps: | |
- checkout | |
- restore_cache: | |
key: app-{{ checksum "build.gradle" }} | |
- run: | |
name: Android SDK Licenses | |
command: ci/android_sdk_licenses.sh | |
- run: | |
name: Create Empty Local Properties | |
command: touch local.properties | |
- run: | |
name: Create Empty Release Keystore | |
command: touch app/release.keystore | |
- run: | |
name: Dependencies | |
command: ./gradlew --no-daemon --stacktrace dependencies | |
- run: | |
name: Run All Unit Tests | |
command: ./gradlew -q testBUILDVARIANTDebugUnitTestCoverage $TEST_FLAGS | |
- store_test_results: | |
path: "MODULE/build/test-results/testBUILDVARIANTDebugUnitTest" | |
- run: | |
name: Send coverage reports to CodeCov | |
command: bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy -f "*testBUILDVARIANTDebugUnitTestCoverage.xml" | |
- save_cache: | |
key: app-{{ checksum "build.gradle" }} | |
paths: | |
- ~/.gradle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
codecov: | |
branch: master | |
coverage: | |
precision: 2 | |
round: down | |
range: "70...100" | |
ignore: | |
- "*/Variant*.kt" | |
- "*/internal/**" | |
- "*/*Activity.kt" | |
comment: | |
layout: "diff, tree" | |
branches: null | |
behavior: default | |
require_changes: yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment