Lona / Lona

A tool for defining design systems and using them to generate cross-platform UI code, Sketch files, and other artifacts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support TravisCI and Danger

NghiaTranUIT opened this issue Β· comments

Suggesting a New Feature

In order to keep this repository consistently, and enforce how the people contribute to the project.
I'd like to introduce the Danger in conjunction with TravisCI.

Summary of Idea

TravisCI
One of famous CI server. It's totally free for OSS like Lona. We leverage the CI system in order to run test and build automatically with effortless.

Danger
Human can't possibly check everything. For instance, the contributor forget to

  • Write unit-test
  • Code convention warning by SwiftLint
  • Warning if it's big PR
  • Warning for WIP for Don't Not Merge PR
  • ...

So let the Danger bot do it. It's potential candidate when conjunction with TravisCI.

Proposed Implementation

Travis

We can inspire how Alamofire construct the .travis.yml file.
It should be

language: objective-c
osx_image: xcode9
rvm:
  - 2.2.2

env:
  global:
    - WORKSPACE="LonaStudio.xcworkspace"
    - OSX_APP_SCHEME="LonaStudio"
    - OSX_SDK=macosx10.13
  matrix:
    - DESTINATION="arch=x86_64"                      SCHEME="$OSX_APP_SCHEME"           SDK="$OSX_SDK"     RUN_TESTS="YES"    BUILD_EXAMPLE="YES"

before_install:
  - bundle install
  - bundle exec pod repo update
  - bundle exec pod install

script:
  - set -o pipefail
  - xcodebuild -version
  - xcodebuild -showsdks
  - xcodebuild -list

    # Build Lona
  - if [ $BUILD_EXAMPLE == "YES" ]; then
      xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO build | xcpretty;
    fi

    # Run Tests
  - if [ $RUN_TESTS == "YES" ]; then
      xcodebuild -workspace "$WORKSPACE" -sdk "$SDK" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO test | xcpretty;
    fi

after_success:
  - bash <(curl -s https://codecov.io/bash)

Danger

Inspired from Danger.
According this their document. It's super easy to create a bot and integrate to our CI system.

Requirement

In order to accomplish, I'd like you to

  1. Setup an Travis account as long as authenticating the Lona Repository.
  2. According to Bot's Danger, we'd sign up new bot account and grant new public_repo token.
    Since you're the owner of Lona πŸ‘

Looking forward to hearing your thought πŸ˜„

πŸ‘ Great thinking. I will create the Travis account or get access to Airbnb's account and create a Danger bot. I haven't tried Danger before but it sounds really helpful.

There's no need for a travis "account", it just uses github auth; I can help you authorize whatever you need with the airbnb org.

@NghiaTranUIT Jordan enabled travis for Lona, and I just gave you write access to the repo. If we add a branch with a .travis.yml we should see the build here: https://travis-ci.org/airbnb/Lona/builds

@NghiaTranUIT I created a bot account and set up the DANGER_GITHUB_API_TOKEN on our Travis account. I think this should be ready to go if you want to try setting it up. I'm also happy to help in any way with setting things up.

This is the bot account!

Thanks all guys. I'm working on it now πŸ‘

Closed by #67