forked from google/open-location-code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
129 lines (117 loc) · 4.74 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# Travis CI configuration.
# Each implementation is listed using the matrix:include configuration.
# Use sudo: required slows boot time but gives us 7.5GB of ram to prevent Bazel running OOM.
sudo: required
dist: trusty
matrix:
include:
# C implementation. Lives in c/, tested with bazel.
- language: c
env: OLC_PATH=c
script:
- wget -O install.sh "https://github.com/bazelbuild/bazel/releases/download/0.24.1/bazel-0.24.1-installer-linux-x86_64.sh"
- chmod +x install.sh
- ./install.sh --user && rm -f install.sh
- ~/bin/bazel test --test_output=all ${OLC_PATH}:all
- cd ${OLC_PATH} && bash clang_check.sh
# C++ implementation. Lives in cpp/, tested with bazel.
- language: cpp
env: OLC_PATH=cpp
script:
- wget -O install.sh "https://github.com/bazelbuild/bazel/releases/download/0.24.1/bazel-0.24.1-installer-linux-x86_64.sh"
- chmod +x install.sh
- ./install.sh --user && rm -f install.sh
- ~/bin/bazel test --test_output=all ${OLC_PATH}:all
- cd cpp && bash clang_check.sh
# Dart implementation. Lives in dart/
- language: dart
dart: stable
env: OLC_PATH=dart
script:
- cd ${OLC_PATH}
- pub get && pub run test
- bash checks.sh
# Go implementation. Lives in go/. Tests fail if files have not been formatted with gofmt.
- language: go
go: stable
env: OLC_PATH=go
script:
- diff -u <(echo -n) <(gofmt -d -s ./go)
- go test -bench=. ./go -v
- go test ./tile_server/gridserver -v
# Java implementation. Lives in java/, tested with bazel and maven.
- language: java
jdk: oraclejdk8
env: OLC_PATH=java
script:
- wget -O install.sh "https://github.com/bazelbuild/bazel/releases/download/0.24.1/bazel-0.24.1-installer-linux-x86_64.sh"
- chmod +x install.sh
- ./install.sh --user && rm -f install.sh
- ~/bin/bazel test --test_output=all ${OLC_PATH}:all && cd ${OLC_PATH} && mvn package
# Javascript Closure library implementation. Lives in js/closure, tested with bazel.
# We use language "c" because bazel will install all the dependencies we need, and we use path "js" for the node_js tests.
# The Bazel configuration is cached. This saves about 3-4 minutes in the tests.
- language: c
env: OLC_PATH=js/closure
before_cache:
# Bazel will fail to install if the installation is in the cache.
- rm -fr ${HOME}/.cache/bazel/_bazel_${USER}/install
cache:
# Set the timeout to fetch and unpack the cache.
timeout: 300
directories:
- ${HOME}/.cache/bazel
script:
- rm -fr ${HOME}/.cache/bazel/_bazel_${USER}/install
- wget -O install.sh "https://github.com/bazelbuild/bazel/releases/download/0.24.1/bazel-0.24.1-installer-linux-x86_64.sh"
- chmod +x install.sh
- ./install.sh --user && rm -f install.sh
- ~/bin/bazel test ${OLC_PATH}:all
- cd js && npm install && ./node_modules/.bin/eslint closure/*js
# Javascript implementation. Lives in js/.
- language: node_js
node_js: "node"
env: OLC_PATH=js
script:
- cd js
- bash checks.sh
# Python implementation. Lives in python/, tested with bazel.
- language: python
python: 2.7
env: OLC_PATH=python
script:
- wget -O install.sh "https://github.com/bazelbuild/bazel/releases/download/0.24.1/bazel-0.24.1-installer-linux-x86_64.sh"
- chmod +x install.sh
- ./install.sh --user && rm -f install.sh
- ~/bin/bazel test --test_output=all ${OLC_PATH}:all
- cd ${OLC_PATH} && bash format_check.sh
# Python implementation. Lives in python/, tested with bazel.
- language: python
python: 3.6
env: OLC_PATH=python
script:
- wget -O install.sh "https://github.com/bazelbuild/bazel/releases/download/0.24.1/bazel-0.24.1-installer-linux-x86_64.sh"
- chmod +x install.sh
- ./install.sh --user && rm -f install.sh
- ~/bin/bazel test --test_output=all ${OLC_PATH}:all
- cd ${OLC_PATH} && bash format_check.sh
# Ruby implementation. Lives in ruby/
- language: ruby
rvm: 2.6.3
env: OLC_PATH=ruby
script:
- gem install rubocop
- gem install test-unit
- cd ruby && ruby test/plus_codes_test.rb
- rubocop --config rubocop.yml
# Rust implementation. Lives in rust/
- language: rust
env: OLC_PATH=rust
before_script:
- rustup component add rustfmt
# Adding caching of .cargo doesn't improve the build/test times.
script:
- cd rust/
- cargo fmt --all -- --check
- cargo build
- cargo test -- --nocapture