From 03a8eb3162b3405197e32c8cb08bb701a57caf79 Mon Sep 17 00:00:00 2001 From: Ryan Plessner Date: Tue, 6 Jan 2015 23:01:19 -0500 Subject: [PATCH] updated readme with travis info --- README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e9400bf..d68f453 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Code coverage can be generated by specifying the `-c ` flag. Right now the valid formats are: `html` and `coveralls`. `html` simply generates html files for each source file containing coverage information and -highlighted source code. +highlighted source code. `coveralls` generates a coveralls coverage report and sends it to coveralls. Using coveralls requires the "COVERALLS_REPO_TOKEN" to be set, and needs bash and curl. @@ -26,6 +26,30 @@ The directory that the coverage is outputted to can be specified with the `-d` f If any tests run by `rackunit` fail, Cover will return with exit code `1`. If all tests pass it will return with exit code `0`. +## Use with TravisCI + +If your code is hosted on a public github repo then you can use this plugin in conjunction with [TravisCI](https://travis-ci.org/) and [Coveralls](https://coveralls.io/). +Just enable your repository on both services and then add a `.travis.yml` file to your repo with the following contents: +```yml +langauge: c +env: + - RACKET_VERSION=6.1.1 + +before_install: + - git clone https://github.com/greghendershott/travis-racket.git ../travis-racket + - cat ../travis-racket/install-racket.sh | bash + +script: + - /usr/racket/bin/raco pkg install --deps search-auto $TRAVIS_BUILD_DIR # install dependencies + - /usr/racket/bin/raco test $TRAVIS_BUILD_DIR # run tests. you wrote tests, right? + - /usr/racket/bin/raco cover -c coveralls -d $TRAVIS_BUILD_DIR/coverage . # generate coverage information +``` +The above Travis configuration will install any project dependencies, test your project, and report coverage information to coveralls. + +For a contrived example project, look at an [example](https://github.com/rpless/rkt-ci-example). +For additional Travis configuration information look at [Travis Racket](https://github.com/greghendershott/travis-racket). + +Note: This currently only works for public Github repos. This project does not support `coveralls.yml` configurations for private repos. ## Internals