Migrate to GitHub Actions (#328)

* Migrate to GitHub Actions

* Delete .travis.yml

* Use the same less strict analysis options

* Replace Travis badge

* Remove --coverage

* Delete dart_test.yaml
diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml
new file mode 100644
index 0000000..3706bf0
--- /dev/null
+++ b/.github/workflows/test-package.yml
@@ -0,0 +1,67 @@
+name: Dart CI
+
+on:
+  # Run on PRs and pushes to the default branch.
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+  schedule:
+    - cron: "0 0 * * 0"
+
+env:
+  PUB_ENVIRONMENT: bot.github
+
+jobs:
+  # Check code formatting and static analysis on a single OS (linux)
+  # against Dart dev.
+  analyze:
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        sdk: [dev]
+    steps:
+      - uses: actions/checkout@v2
+      - uses: dart-lang/setup-dart@v0.3
+        with:
+          sdk: ${{ matrix.sdk }}
+      - id: install
+        name: Install dependencies
+        run: dart pub get
+      - name: Check formatting
+        run: dart format --output=none --set-exit-if-changed .
+        if: always() && steps.install.outcome == 'success'
+      - name: Analyze code
+        run: dart analyze lib
+        if: always() && steps.install.outcome == 'success'
+
+  # Run tests on a matrix consisting of two dimensions:
+  # 1. OS: ubuntu-latest, (macos-latest, windows-latest)
+  # 2. release channel: dev
+  test:
+    needs: analyze
+    runs-on: ${{ matrix.os }}
+    strategy:
+      fail-fast: false
+      matrix:
+        # Add macos-latest and/or windows-latest if relevant for this package.
+        os: [ubuntu-latest]
+        sdk: [dev]
+    steps:
+      - uses: actions/checkout@v2
+      - uses: dart-lang/setup-dart@v0.3
+        with:
+          sdk: ${{ matrix.sdk }}
+      - id: install
+        name: Install dependencies
+        run: dart pub get
+      - name: Run VM tests
+        run: dart run build_runner test -- --platform vm
+        if: always() && steps.install.outcome == 'success'
+      - name: Run DDC build
+        run: dart run build_runner build --fail-on-severe
+        if: always() && steps.install.outcome == 'success'
+      - name: Run DDC tests
+        run: dart run build_runner test -- --platform chrome
+        if: always() && steps.install.outcome == 'success'
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index d38251c..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,71 +0,0 @@
-language: dart
-
-# Build stages: https://docs.travis-ci.com/user/build-stages/.
-stages:
-- presubmit
-- build
-- testing
-
-# 1. Run dartfmt, dartanalyzer, pub run test (VM).
-# 2. Then run a build.
-# 3. Then run tests compiled via dartdevc and dart2js.
-jobs:
-    include:
-    # mockito tests cannot run on stable until stable is >= 2.10.0, as "2.10.0"
-    # is the version required by analyzer. See
-    # https://github.com/dart-lang/build/issues/2685.
-    #- stage: presubmit
-    #  name: "2.9.0 analyzer"
-    #  script: ./tool/travis.sh dartanalyzer
-    #  dart: 2.9.0
-    #- stage: presubmit
-    #  name: "2.9.0 vm test"
-    #  script: ./tool/travis.sh vm_test
-    #  dart: 2.9.0
-    #- stage: build
-    #  name: "2.9.0 DDC build"
-    #  script: ./tool/travis.sh dartdevc_build
-    #  dart: 2.9.0
-    #- stage: testing
-    #  name: "2.9.0 DDC test"
-    #  script: ./tool/travis.sh dartdevc_test
-    #  dart: 2.9.0
-    #- stage: testing
-    #  name: "2.9.0 code coverage"
-    #  script: ./tool/travis.sh coverage
-    #  dart: 2.9.0
-
-    - stage: presubmit
-      name: "dev dartfmt"
-      script: ./tool/travis.sh dartfmt
-      dart: dev
-    - stage: presubmit
-      name: "dev analyzer"
-      script: ./tool/travis.sh dartanalyzer
-      dart: dev
-    - stage: presubmit
-      name: "dev vm test"
-      script: ./tool/travis.sh vm_test
-      dart: dev
-    - stage: build
-      name: "dev DDC build"
-      script: ./tool/travis.sh dartdevc_build
-      dart: dev
-    - stage: testing
-      name: "dev DDC test"
-      script: ./tool/travis.sh dartdevc_test
-      dart: dev
-    - stage: testing
-      name: "dev code coverage"
-      script: ./tool/travis.sh coverage
-      dart: dev
-
-# Only building master means that we don't run two builds for each pull request.
-branches:
-    only: [master]
-
-# Incremental pub cache and builds.
-cache:
-    directories:
-    - $HOME/.pub-cache
-    - .dart_tool
diff --git a/README.md b/README.md
index a6c8a38..b068e7d 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
 Mock library for Dart inspired by [Mockito](https://github.com/mockito/mockito).
 
 [![Pub](https://img.shields.io/pub/v/mockito.svg)](https://pub.dev/packages/mockito)
-[![Build Status](https://travis-ci.org/dart-lang/mockito.svg?branch=master)](https://travis-ci.org/dart-lang/mockito)
+[![Build Status](https://github.com/dart-lang/mockito/workflows/Dart%20CI/badge.svg)](https://github.com/dart-lang/mockito/actions?query=workflow%3A"Dart+CI"+branch%3Amaster)
 
 ## Let's create mocks
 
diff --git a/dart_test.yaml b/dart_test.yaml
deleted file mode 100644
index 0a3cb47..0000000
--- a/dart_test.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-# TODO(https://github.com/dart-lang/test/issues/772): Headless chrome timeout.
-override_platforms:
-  chrome:
-    settings:
-      headless: false