Skip to content

Commit b8367cf

Browse files
author
Melih Aksoy
committed
Working on CI
Working on CI
1 parent 46eaaf7 commit b8367cf

File tree

4 files changed

+63
-29
lines changed

4 files changed

+63
-29
lines changed

.circleci/config.yml

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
1-
# Use the latest 2.1 version of CircleCI pipeline processing engine, see https://circleci.com/docs/2.0/configuration-reference/
2-
version: 2.1
3-
4-
# Use a package of configuration called an orb, see https://circleci.com/docs/2.0/orb-intro/
5-
orbs:
6-
# Declare a dependency on the welcome-orb
7-
welcome: circleci/[email protected]
8-
9-
# Orchestrate or schedule a set of jobs, see https://circleci.com/docs/2.0/workflows/
10-
workflows:
11-
# Name the workflow "Welcome"
12-
Welcome:
13-
# Run the welcome/run job in its own container
14-
jobs:
15-
- welcome/run
1+
version: 2
2+
jobs:
3+
build:
4+
working_directory: ~/code
5+
docker:
6+
- image: circleci/android:api-28
7+
environment:
8+
JVM_OPTS: -Xmx3200m
9+
steps:
10+
- checkout
11+
- restore_cache:
12+
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
13+
# - run:
14+
# name: Chmod permissions #if permission for Gradlew Dependencies fail, use this.
15+
# command: sudo chmod +x ./gradlew
16+
- run:
17+
name: Install bundle
18+
command: |
19+
gem install bundler
20+
bundle install
21+
- run:
22+
name: Detekt
23+
command: fastlane detekt
24+
- store_artifacts: # for display in Artifacts: https://circleci.com/docs/2.0/artifacts/
25+
path: reports/detekt
26+
- store_test_results: # for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/
27+
path: reports/tests
28+
# See https://circleci.com/docs/2.0/deployment-integrations/ for deploy examples

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
# Rocket Science
2+
3+
[![CircleCI](https://circleci.com/gh/melihaksoy/RocketScience/tree/dev.svg?style=svg)](https://circleci.com/gh/melihaksoy/RocketScience/tree/dev)

build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,10 @@ task clean(type: Delete) {
3636
delete rootProject.buildDir
3737
}
3838

39+
task removeReports(type: Delete) {
40+
delete fileTree(rootProject.projectDir.path + "/reports") {
41+
include '**/*.*'
42+
}
43+
}
44+
3945
apply from: "scripts/dependencies.gradle"

fastlane/Fastfile

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,39 @@
1313
# Uncomment the line if you want fastlane to automatically update itself
1414
# update_fastlane
1515

16+
# ================ Platform ================
17+
1618
default_platform(:android)
1719

20+
# ================ Lanes ================
21+
1822
platform :android do
19-
desc "Runs all the tests"
20-
lane :test do
21-
gradle(task: "test")
23+
24+
before_all do
25+
clean_reports()
26+
end
27+
28+
desc "Detekt checks"
29+
lane :detekt do
30+
run_detekt()
31+
end
32+
33+
desc "Runs all tests in all modules"
34+
lane :test_all do
35+
run_all_tests()
36+
end
37+
38+
# ================ Gradle tasks ================
39+
40+
def run_detekt
41+
gradle(task: "detekt --continue")
2242
end
2343

24-
desc "Submit a new Beta Build to Crashlytics Beta"
25-
lane :beta do
26-
gradle(task: "clean assembleRelease")
27-
crashlytics
28-
29-
# sh "your_script.sh"
30-
# You can also use other beta testing services here
44+
def clean_reports
45+
gradle(task: "removeReports")
3146
end
3247

33-
desc "Deploy a new version to the Google Play"
34-
lane :deploy do
35-
gradle(task: "clean assembleRelease")
36-
upload_to_play_store
48+
def run_all_tests
49+
gradle(task: "test --continue")
3750
end
3851
end

0 commit comments

Comments
 (0)