Update .travis.yml. (#82)

Separate install and test steps into scripts. Add entries to build
matrix for running the tests, so the dartfmt and analyzer steps also get
to run.
diff --git a/.travis.yml b/.travis.yml
index 8ece593..8f75be8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,20 +1,24 @@
 language: dart
 sudo: false
 
-dart:
-- dev
-- stable
-
 # Only run one instance of the formatter and the analyzer, rather than running
 # them against each Dart version.
 matrix:
   include:
   - dart: stable
     dart_task: dartfmt
+  - dart: stable
     env: PROTOC_VERSION=3.0.0
+    install: ./tool/travis/setup.sh
+    script: ./tool/travis/test.sh
   - dart: dev
-    dart_task: dartanalyzer
     env: PROTOC_VERSION=3.3.0
+    install: ./tool/travis/setup.sh
+    script: ./tool/travis/analyze.sh
+  - dart: dev
+    env: PROTOC_VERSION=3.3.0
+    install: ./tool/travis/setup.sh
+    script: ./tool/travis/test.sh
 
 branches:
   only: [master]
@@ -22,13 +26,3 @@
 cache:
   directories:
   - $HOME/.pub-cache
-
-install:
-  - wget https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip
-  - unzip protoc-$PROTOC_VERSION-linux-x86_64.zip
-  - export PATH=bin:$PATH
-
-script:
-  - dart --version
-  - protoc --version
-  - make clean run-tests
diff --git a/tool/travis/analyze.sh b/tool/travis/analyze.sh
new file mode 100755
index 0000000..42e3d43
--- /dev/null
+++ b/tool/travis/analyze.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+set -ev
+
+PATH=$HOME/protoc/bin:$PATH
+protoc --version
+dartanalyzer --version
+pub get
+make protos
+dartanalyzer .
diff --git a/tool/travis/setup.sh b/tool/travis/setup.sh
new file mode 100755
index 0000000..114befe
--- /dev/null
+++ b/tool/travis/setup.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+set -ev
+
+mkdir $HOME/protoc
+pushd $HOME/protoc
+wget https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip
+unzip protoc-$PROTOC_VERSION-linux-x86_64.zip
+popd
diff --git a/tool/travis/test.sh b/tool/travis/test.sh
new file mode 100755
index 0000000..cd30c94
--- /dev/null
+++ b/tool/travis/test.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+set -ev
+
+PATH=$HOME/protoc/bin:$PATH
+protoc --version
+pub get
+make clean run-tests