Skip to content

Latest commit

 

History

History
executable file
·
92 lines (71 loc) · 3.11 KB

File metadata and controls

executable file
·
92 lines (71 loc) · 3.11 KB

Contributing Guide

Contributing to ci-github-bot is fairly easy. This document shows you how to get the project, run all provided tests and generate a production-ready build.

It also covers provided grunt tasks that help you develop with ci-github-bot.

Dependencies

To make sure that the following instructions work, please install the following dependencies on you machine:

  • Node.js (comes with a bundles npm)
  • Git

Installation

To get the source of ci-github-bot, clone the git repository via:

$ git clone https://github.com/clickalicious/ci-github-bot

This will clone the complete source to your local machine. Navigate to the project folder and install all needed dependencies via npm:

$ npm install

This commands installs everything which is required for building and testing the project.

Testing

Internally ci-github-bot depends on Grunt, however we have masked all steps behind simple tasks processed by npm.

Source linting: npm run lint

npm run lint performs a lint for all, also part of test.

Unit testing: npm run test

npm run test executes (as you might think) the unit tests, which are located in test/unit. The task uses karma, the spectacular test runner, to execute the tests with the jasmine testing framework.

Building

Standard build

You will probably being never required using the command npm run build, because it will create a production-ready build of ci-github-bot. This task will also lint, test and minify the source. After running this task, you'll find the following files in a generated /distfolder:

dist/ci-github-bot.js
dist/ci-github-bot.min.js

Developing

grunt watch

This task will watch all relevant files. When it notices a change, it'll run the lint and test tasks. Use this task while developing on the source to make sure that every time you make a change, you get notified if your code is inconsistent or doesn't pass the tests.

grunt dev

This task extends watch. In addition, it will lint, test and copy the result into demo/. After this, just like watch, it will run these steps every time a file has changed. On top of that, this task supports live reloading (on default port).

Contributing/Submitting changes

  • Check out a new branch based on develop and name it to what you intend to do:
    • Example:
      $ git checkout -b BRANCH_NAME origin/develop
      
      If you get an error, you may need to fetch develop first by using
      $ git remote update && git fetch
      
    • Use one branch per fix/feature
  • Make your changes
    • Make sure to provide a spec for unit tests.
    • Run your tests with either karma start or grunt test.
    • When all tests pass, everything's fine.
  • Commit your changes
    • Please provide a git message that explains what you've done.
    • Commit to the forked repository.
  • Make a pull request
    • Make sure you send the PR to the develop branch.
    • CirlceCI is watching you!

If you follow these instructions, your PR will land pretty safely in the main repo!