Skip to content

Commit e7e5d77

Browse files
Merge pull request #6 from Workiva/travis_ci
CPLAT-6258 Setup Travis CI
2 parents f516902 + 67500ea commit e7e5d77

File tree

4 files changed

+45
-36
lines changed

4 files changed

+45
-36
lines changed

.travis.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
language: dart
2+
3+
# This is necessary to use proper Chrome. Travis's version of chromium is from
4+
# 2014.
5+
sudo: required
6+
dist: trusty
7+
addons:
8+
chrome: stable
9+
apt:
10+
sources:
11+
- google-chrome
12+
packages:
13+
- google-chrome-stable
14+
15+
dart:
16+
- 2.3.2
17+
- stable
18+
- dev
19+
20+
with_content_shell: false
21+
22+
before_install:
23+
- export CHROMEDRIVER_BINARY=/usr/bin/google-chrome
24+
- export CHROMEDRIVER_ARGS=--no-sandbox
25+
- /usr/bin/google-chrome --version
26+
- export DISPLAY=:99.0
27+
- sh -e /etc/init.d/xvfb start
28+
29+
before_script:
30+
- wget http://chromedriver.storage.googleapis.com/2.46/chromedriver_linux64.zip
31+
- unzip chromedriver_linux64.zip
32+
- export PATH=$PATH:$PWD
33+
- pub get
34+
35+
script:
36+
- dartanalyzer .
37+
- dartfmt -n --set-exit-if-changed .
38+
- pub run test
39+
40+
cache:
41+
directories:
42+
- $HOME/.pub-cache

Dockerfile

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,7 @@
11
FROM google/dart:2.3
2-
3-
RUN apt-get update -qq
4-
RUN apt-get update && apt-get install -y \
5-
# wget is used to install chrome and chromedriver
6-
wget \
7-
# unzip is used to unzip chromedriver
8-
unzip \
9-
# xvfb is used to run chromedriver headless
10-
xvfb \
11-
&& rm -rf /var/lib/apt/lists/*
12-
13-
# Install chrome
14-
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
15-
RUN echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list
16-
RUN apt-get -qq update && apt-get install -y google-chrome-stable
17-
RUN mv /usr/bin/google-chrome-stable /usr/bin/google-chrome
18-
RUN sed -i --follow-symlinks -e 's/\"\$HERE\/chrome\"/\"\$HERE\/chrome\" --no-sandbox/g' /usr/bin/google-chrome
19-
20-
# Install chromedriver
21-
WORKDIR /chromedriver/
22-
RUN wget http://chromedriver.storage.googleapis.com/2.46/chromedriver_linux64.zip
23-
RUN unzip chromedriver_linux64.zip
24-
RUN mv chromedriver /usr/bin/chromedriver
25-
ENV CHROMEDRIVER_BINARY="/usr/bin/google-chrome"
26-
ENV CHROMEDRIVER_ARGS="--no-sandbox"
27-
ENV DISPLAY=":99.0"
28-
RUN Xvfb :99.0 -screen 0 800x600x16 &
29-
30-
RUN /usr/bin/google-chrome --version
31-
2+
RUN apt-get update -qq && rm -rf /var/lib/apt/lists/*
323
WORKDIR /build/
334
ADD pubspec.yaml .
345
RUN pub get
35-
ADD . .
36-
RUN dartanalyzer .
37-
RUN dartfmt -n --set-exit-if-changed .
38-
RUN pub run test
39-
406
ARG BUILD_ARTIFACTS_BUILD=/build/pubspec.lock
417
FROM scratch

dart_test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
concurrency: 1
22
reporter: expanded
3+
retry: 2

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ authors:
1212
- Evan Weible <[email protected]>
1313

1414
environment:
15-
sdk: ">=2.3.0 <3.0.0"
15+
sdk: ">=2.3.2 <3.0.0"
1616

1717
dependencies:
1818
args: ^1.5.1

0 commit comments

Comments
 (0)