forked from google/open-location-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
231 lines (213 loc) · 9.37 KB
/
.travis.yml
File metadata and controls
231 lines (213 loc) · 9.37 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# 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: bionic
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.
# Only testing LTS releases of oraclejdk
# Ref: https://www.oracle.com/technetwork/java/java-se-support-roadmap.html
- language: java
jdk: oraclejdk8
# Java 8 requires dist: trusty
dist: trusty
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
# Java implementation. Lives in java/, tested with bazel and maven.
- language: java
jdk: openjdk8
# Java 8 requires dist: trusty
dist: trusty
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
# Java implementation. Lives in java/, tested with bazel and maven.
- language: java
jdk: openjdk9
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
# Java implementation. Lives in java/, tested with bazel and maven.
- language: java
jdk: openjdk10
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
## TODO: Fix java11+ issues with javadoc archive
## Ref: https://travis-ci.org/google/open-location-code/jobs/630142096#L2404
# # Java implementation. Lives in java/, tested with bazel and maven.
# # Only testing LTS releases of oraclejdk
# # Ref: https://www.oracle.com/technetwork/java/java-se-support-roadmap.html
# - language: java
# jdk: oraclejdk11
# 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
#
# # Java implementation. Lives in java/, tested with bazel and maven.
# - language: java
# jdk: openjdk11
# 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
#
# # Java implementation. Lives in java/, tested with bazel and maven.
# - language: java
# jdk: openjdk12
# 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
#
# # Java implementation. Lives in java/, tested with bazel and maven.
# - language: java
# jdk: openjdk13
# 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
# Python implementation. Lives in python/, tested with bazel.
- language: python
python: 3.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.8
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