Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plant CI #50

Open
wants to merge 2 commits into
base: tisch-merge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sudo: false

language: python

python:
- 2.7

script:
- ./ci script
9 changes: 9 additions & 0 deletions ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -ev # Ref https://docs.travis-ci.com/user/customizing-the-build/#Implementing-Complex-Build-Steps

case "${1:?}" in
script)
./merge.py
;;
esac
13 changes: 3 additions & 10 deletions merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import glob
import re
import sys


def morphgnt():
Expand Down Expand Up @@ -35,19 +36,12 @@ class Counter:
def __init__(self, show_all=False):
self.show_all = show_all
self.success_count = 0
self.skip_count = 0
self.fail_count = 0
self.first_fail = None
self.first_skip = None

def success(self):
self.success_count += 1

def skip(self, message):
self.skip_count += 1
if self.first_skip is None:
self.first_skip = message

def fail(self, message):
if self.show_all:
print(message)
Expand All @@ -56,11 +50,9 @@ def fail(self, message):
self.first_fail = message

def results(self):
print("{} success; {} fail; {} skipped".format(self.success_count, self.fail_count, self.skip_count))
print("{} success; {} fail".format(self.success_count, self.fail_count))
if self.first_fail:
print("first fail: {}".format(self.first_fail))
if self.first_skip:
print("first skip: {}".format(self.first_skip))


counter = Counter()
Expand All @@ -75,3 +67,4 @@ def results(self):
counter.fail("{}: {}".format(row["bcv"], " ".join(data)))

counter.results()
sys.exit(0 if counter.fail_count == 0 else 1)