Skip to content

Commit

Permalink
Setup Travis CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwang Yul Seo committed Dec 9, 2015
1 parent 7878772 commit 14e5fe9
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
@@ -0,0 +1,8 @@
language: dart
sudo: false
dart:
- stable
- dev
script: ./tool/travis.sh
env:
- DARTANALYZER_FLAGS=--fatal-warnings
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -8,6 +8,9 @@ which is in turn based on the paper
[The Interval Skip List](https://www.cise.ufl.edu/tr/DOC/REP-1992-45.pdf) by
Eric N. Hanson.

[![Build Status](https://travis-ci.org/kseo/interval_skip_list.svg)](https://travis-ci.org/kseo/interval_skip_list)
[![Coverage Status](https://coveralls.io/repos/kseo/interval_skip_list/badge.svg?branch=master&service=github)](https://coveralls.io/github/kseo/interval_skip_list?branch=master)

## Basic Usage Example

```dart
Expand Down
10 changes: 10 additions & 0 deletions test/all_tests.dart
@@ -0,0 +1,10 @@
// Copyright (c) 2015, Kwang Yul Seo. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

library interval_skip_list.test;

import 'interval_skip_list_test.dart' as interval_skip_list_test;

void main() {
interval_skip_list_test.main();
}
28 changes: 28 additions & 0 deletions tool/travis.sh
@@ -0,0 +1,28 @@
#!/bin/bash

# Copyright (c) 2015, Google Inc. Please see the AUTHORS file for details.
# All rights reserved. Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

# Fast fail the script on failures.
set -e

# Verify that the libraries are error and warning-free.
echo "Running dartanalyzer..."
libs=$(find lib -maxdepth 1 -type f -name '*.dart')
dartanalyzer $DARTANALYZER_FLAGS $libs test/all_tests.dart

# Run the tests.
echo "Running tests..."
pub run test:test

# Gather and send coverage data.
if [ "$REPO_TOKEN" ] && [ "$TRAVIS_DART_VERSION" = "stable" ]; then
echo "Collecting coverage..."
pub global activate dart_coveralls
pub global run dart_coveralls report \
--token $REPO_TOKEN \
--retry 2 \
--exclude-test-files \
test/all_tests.dart
fi

0 comments on commit 14e5fe9

Please sign in to comment.