Working on CI

Working on CI
This commit is contained in:
Melih Aksoy
2019-07-01 17:18:09 +02:00
parent 46eaaf7549
commit b8367cf768
4 changed files with 63 additions and 29 deletions

View File

@@ -1,15 +1,28 @@
# Use the latest 2.1 version of CircleCI pipeline processing engine, see https://circleci.com/docs/2.0/configuration-reference/
version: 2.1
# Use a package of configuration called an orb, see https://circleci.com/docs/2.0/orb-intro/
orbs:
# Declare a dependency on the welcome-orb
welcome: circleci/welcome-orb@0.3.1
# Orchestrate or schedule a set of jobs, see https://circleci.com/docs/2.0/workflows/
workflows:
# Name the workflow "Welcome"
Welcome:
# Run the welcome/run job in its own container
jobs:
- welcome/run
version: 2
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-28
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
# - run:
# name: Chmod permissions #if permission for Gradlew Dependencies fail, use this.
# command: sudo chmod +x ./gradlew
- run:
name: Install bundle
command: |
gem install bundler
bundle install
- run:
name: Detekt
command: fastlane detekt
- store_artifacts: # for display in Artifacts: https://circleci.com/docs/2.0/artifacts/
path: reports/detekt
- store_test_results: # for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/
path: reports/tests
# See https://circleci.com/docs/2.0/deployment-integrations/ for deploy examples

View File

@@ -1 +1,3 @@
# Rocket Science
[![CircleCI](https://circleci.com/gh/melihaksoy/RocketScience/tree/dev.svg?style=svg)](https://circleci.com/gh/melihaksoy/RocketScience/tree/dev)

View File

@@ -36,4 +36,10 @@ task clean(type: Delete) {
delete rootProject.buildDir
}
task removeReports(type: Delete) {
delete fileTree(rootProject.projectDir.path + "/reports") {
include '**/*.*'
}
}
apply from: "scripts/dependencies.gradle"

View File

@@ -13,26 +13,39 @@
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
# ================ Platform ================
default_platform(:android)
# ================ Lanes ================
platform :android do
desc "Runs all the tests"
lane :test do
gradle(task: "test")
before_all do
clean_reports()
end
desc "Submit a new Beta Build to Crashlytics Beta"
lane :beta do
gradle(task: "clean assembleRelease")
crashlytics
# sh "your_script.sh"
# You can also use other beta testing services here
desc "Detekt checks"
lane :detekt do
run_detekt()
end
desc "Deploy a new version to the Google Play"
lane :deploy do
gradle(task: "clean assembleRelease")
upload_to_play_store
desc "Runs all tests in all modules"
lane :test_all do
run_all_tests()
end
# ================ Gradle tasks ================
def run_detekt
gradle(task: "detekt --continue")
end
def clean_reports
gradle(task: "removeReports")
end
def run_all_tests
gradle(task: "test --continue")
end
end