Giter Site home page Giter Site logo

ci_travis_demo's Introduction

Build POS app on Travis CI

Build Status Maintainability Test Coverage

Build app with Travis CI

  • Sign up to Travis CI with your Github account.
  • Click the green Activate button, and select the repositories you want to use with Travis CI.
  • Add a .travis.yml file with the following content to your repository to tell Travis CI what to do:
language: java

jdk:
 - oraclejdk8
  • commit and push your changes to the github repo.
  • New build will be triggered

Run tests and measure code coverage

  • To measure code coverage we will use JaCoCo gradle plugin
  • Add following lines to build.gradle file:
apply plugin: "jacoco"
<...>
jacoco {
   toolVersion = "0.8.1"
}

jacocoTestReport {
   reports {
       xml.enabled=true
   }
}
  • Add script step to the .travis.yml file:
- gradle test jacocoTestReport
  • commit these changes. If some of unit tests fail the build becomes red

Track code coverage and code quality using Code climate

  • Sign up to Code climate with your Github account.
  • Activate "Free for open source" account
  • Add Github repository
  • To analyze your code with each commit on Code Climate navigate to Pero Settings -> Test Coverage -> Copy TEST_REPORTED_ID key
  • Add following lines to your .travis.yml file:
env:
 global:
   - CC_TEST_REPORTER_ID=<your_test_reporter_id>
 before_script:
 - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
 - chmod +x ./cc-test-reporter
 - ./cc-test-reporter before-build

script:
- gradle test jacocoTestReport
- JACOCO_SOURCE_PATH=src/main/java ./cc-test-reporter format-coverage ./build/reports/jacoco/test/jacocoTestReport.xml --input-type jacoco
- ./cc-test-reporter upload-coverage -r $CC_TEST_REPORTER_ID
  • If no mistakes your next build will trigger code coverage analysis on Code climate

ci_travis_demo's People

Contributors

omelkova 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.