forked from google/grumpy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
63 lines (57 loc) · 1.82 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
language: python
cache:
directories:
- $HOME/.cache/pip
- $HOME/.cache/pre-commit
matrix:
allow_failures:
- python: 3.6
- env: GO="stable"
include:
- python: 2.7
env: GO=1.10.x
- python: 2.7
env: GO=stable # Currently 1.11
- python: 3.6
env: GO=1.10.x
script: # To detect Python 3 syntax errors in grumpy-tools
- pip install --upgrade flake8
- flake8 --count --select=E901,E999,F821,F822,F823 --show-source --statistics grumpy-tools-src
- os: osx
language: go
go: 1.10.x
env: OSX_PYTHON=2.7
install: brew install python@2
install:
- |
export GOPATH=~/gopath
export PATH="$GOPATH/bin:$PATH"
export TRAVIS_BUILD_DIR="$GOPATH/src/github.com/$TRAVIS_REPO_SLUG"
mkdir -p "$TRAVIS_BUILD_DIR"
rsync -az . "$TRAVIS_BUILD_DIR"
cd "$TRAVIS_BUILD_DIR"
# Use the current gimme because Travis gimme does not support syntax "1.10.x" and "stable"
eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=${GO} bash)"
before_script:
- go version && python --version && python -m pip --version
# https://github.com/travis-ci/travis-ci/issues/8920#issuecomment-352661024
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)"
- pip install --upgrade pip
- pip install pytest pytest-cov coverage
script:
# Install the thing
- cd grumpy-tools-src
- pip install .
- which grumpy
- cd ../grumpy-runtime-src
- pip install .
# Test the thing
# Run gofmt and lint serially to avoid confusing output. Run tests in parallel
# for speed.
- cd ../grumpy-tools-src
- pytest
- cd ../grumpy-runtime-src
- make gofmt lint && make -j2 test
# OSX swallows error logs: https://github.com/travis-ci/travis-ci/issues/6018
after_error:
- echo "== End of test log ==""