GithubHelp home page GithubHelp logo

ajaymache / travis-ci-with-github Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 3.0 396 KB

Getting started with Travis CI for Github

License: MIT License

Python 100.00%
travis-ci-configuration travis-ci travis-ci-demo travis-ci-github travis-ci-python travis-ci-tutrorial

travis-ci-with-github's Introduction


 Travis     license     GitHub issues     GitHub language count     GitHub contributors     Contributions  

About

This repository aims at getting started with Travis CI for your Github repositories. For demonstration purposes a very simple package is created with some test cases to explain how to integrate Travis CI for continous integration with Github.

What is Travis CI?

Travis CI is a hosted, distributed continuous integration service used to build and test software projects hosted at GitHub. Open source projects may be tested at no charge via https://travis-ci.org. Private projects may be tested at https://travis-ci.com on a fee basis. TravisPro provides custom deployments of a proprietary version on the customer's own hardware. (Source - Wikipedia)

Getting started  :running:

  • The folder pkg contains a arithmetic package which has been created for demonstration puposes. The folder pkg has 2 sub-folders arithmetic and testing with files arithmetic.py and testing.py.

  • The arithmetic.py file is a simple module to do arithmetic operations like addition, subtraction, multiplication and division. The testing.py file is another simple module which runs some testcases on the package.

  • To successfully integrate Travis CI with your Github repository you will need:

    Step 1: Github repository for which you want to integrate Travis CI with

    Step 2: Sign In with your Github account on https://travis-ci.org

    Step 3: Activate the github repository from the Travis CI console for which you want to do the integration

    Step 4: Trigger the build by doing a push to the repository

    Step 5: Finally check status on Travis CI console to verify if your build passed or failed

Step 1: Creating or identifying github repository

  • Create a github repository like this one or identify the github repository you would like to integrate with Travis CI.
  • ⚠️ Note that the this repository should be public and not private.

Step 2: Sign In with your Github account   🔐

  • Fairly straight forward, go to https://travis-ci.org and login with your Github credentials as shown below:

Sign In with your github credentials

Step 3: Activate github repository   ✅

  • After you login, navigate to the left of your console as shown below and click on the + sign as shown below:

Click the '+' sign

  • After clicking the + sign you will be able to see all your public repositories

  • Activate your repository for integration with Travis CI by turning on the button next to your repository as shown below:

turn on the activate button

Step 4: Trigger the build   🚧

  • This is the most important step of all the steps. You will need a .travis.yml file to trigger the Travis CI build.

  • A .travis.yml or a YAML is a simple human readible data serialization configuration file which tells Travis CI what to do once you trigger the build. For example like the one shown below:

       #declaring the type of language
       language: python
       
       #declaring the versions of the language specified above  you to want the test the code against
       python:
           - "3.5"
       
       #before executing the code installing the dependencies if any
       install:
           - pip install -r requirements.txt
       
       #running the desired code file for testing your code
       script:
           - mypy pkg/arithmetic/arithmetic.py

Step 5: Status check   🏁

  • Travis CI will start start the build by executing the steps as outlined in the .travis.yml, you can also verify this by checking the logs in the console after logging into your Travis CI account as shown below:

see the logs

  • You can also verify if your build passed ✅ or failed ❌ by looking at the build batch on the top of the console as shown below:

see the logs

Thanks for taking time ⏰ to stop by and please feel free to star ⭐, fork 🔧 the repository or report any bug 🪲 in the issues section of the repository 😃

travis-ci-with-github's People

Contributors

ajaymache avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.