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
87 changes: 87 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
version: 2

defaults: &defaults
macos:
xcode: "10.2.0"
working_directory: /Users/distiller/project
environment:
FL_OUTPUT_DIR: /Users/distiller/project/output
GYM_OUTPUT_NAME: app
# For fix ruby error
shell: /bin/bash --login -eo pipefail

jobs:
build:
<<: *defaults
steps:
- checkout

- run:
name: Set Ruby Version
command: echo "ruby-2.4" > .ruby-version

- restore_cache:
keys:
- v1-gems-{{ checksum "Gemfile.lock" }}
- v1-gems-
- run:
name: Install RubyGems
command: bundle install --path vendor/bundle
- save_cache:
key: v1-gems-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle

# - run:
# name: Install SwiftLint
# command: brew install swiftlint

# - run:
# name: Decrypt resource
# command: openssl aes-256-cbc -k $DECRYPT_KEY -d -in JobChat/Resources/Staging/encrypted_GoogleService-Info.plist -out JobChat/Resources/Staging/GoogleService-Info.plist

# - run:
# name: Run unit test
# command: bundle exec fastlane test
- run:
name: Run Danger
command: bundle exec danger

- store_artifacts:
path: /Users/distiller/project/output
destination: output
- store_test_results:
path: /Users/distiller/project/output/scan

- persist_to_workspace:
root: /Users/distiller/project
paths:
- .

deploy:
<<: *defaults
steps:
- attach_workspace:
at: /Users/distiller/project
# - run:
# command: base64 -D -o certificates/Certificates.p12 <<< $Certificates
# - run:
# command: base64 -D -o certificates/JobChatStgAdHocProvision.mobileprovision <<< $profile
- run:
name: Build ipa & upload
command: bundle exec fastlane beta
- store_artifacts:
path: /Users/distiller/project/output
destination: output

workflows:
version: 2
build_and_deploy:
jobs:
- build:
filters:
tags:
only: /^v.*/
- deploy:
requires:
- build
40 changes: 40 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
disabled_rules:
- identifier_name
- trailing_whitespace

excluded: # paths to ignore during linting. Takes precedence over `included`.
- Pods
- Carthage
- JobChat/Utils/Libraries

opt_in_rules:
- empty_count
- empty_string

line_length:
warning: 150
error: 200
ignores_function_declarations: true
ignores_comments: true
ignores_urls: true

function_body_length:
warning: 50
error: 100

type_body_length:
warning: 300
error: 500

cyclomatic_complexity:
warning: 15
error: 25
ignores_case_statements: true

function_parameter_count:
warning: 4
error: 6

file_length:
warning: 1000
error: 1500
11 changes: 11 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# github comment settings
github.dismiss_out_of_range_messages

# for PR
if github.pr_title.include?('[WIP]') || github.pr_labels.include?('WIP')
warn('PR is classed as Work in Progress')
end

# Warn when there is a big PR
warn('a large PR') if git.lines_of_code > 500

6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source "https://rubygems.org"

gem 'cocoapods'
gem 'fastlane'
gem 'danger'
gem 'danger-swiftlint'
Loading