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
version: 2.1 jobs:
build:
# Use a package of configuration called an orb, see https://circleci.com/docs/2.0/orb-intro/ working_directory: ~/code
orbs: docker:
# Declare a dependency on the welcome-orb - image: circleci/android:api-28
welcome: circleci/welcome-orb@0.3.1 environment:
JVM_OPTS: -Xmx3200m
# Orchestrate or schedule a set of jobs, see https://circleci.com/docs/2.0/workflows/ steps:
workflows: - checkout
# Name the workflow "Welcome" - restore_cache:
Welcome: key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
# Run the welcome/run job in its own container # - run:
jobs: # name: Chmod permissions #if permission for Gradlew Dependencies fail, use this.
- welcome/run # 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 # 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 delete rootProject.buildDir
} }
task removeReports(type: Delete) {
delete fileTree(rootProject.projectDir.path + "/reports") {
include '**/*.*'
}
}
apply from: "scripts/dependencies.gradle" apply from: "scripts/dependencies.gradle"

View File

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