Migrate to GitHub actions

Delete travis-ci config

Closes https://github.com/google/webdriver.dart/pull/229

PiperOrigin-RevId: 353005896
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
new file mode 100644
index 0000000..4fba63d
--- /dev/null
+++ b/.github/workflows/ci.yaml
@@ -0,0 +1,72 @@
+name: 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 # More cleanup-needed --fatal-infos
+      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 }}
+    - uses: nanasess/setup-chromedriver@v1.0.1
+    - uses: browser-actions/setup-geckodriver@v0.0.0
+    - id: install
+      name: Install dependencies
+      run: dart pub get
+    - name: test
+      run: |
+        export DISPLAY=:99
+        chromedriver --port=4444 --url-base=/wd/hub &
+        geckodriver --port=4445 &
+        sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
+        pub run test -j 1
+      if: always() && steps.install.outcome == 'success'
+      env:
+        # until sync_http is migrated to null safety
+        DART_VM_OPTIONS: "--no-sound-null-safety"
+        CHROMEDRIVER_ARGS: '--no-sandbox --headless'
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index ff6d099..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-language: dart
-# This is necessary to use proper Chrome. Travis's version of chromium is from
-# 2014.
-dist: trusty
-addons:
-  apt:
-    sources:
-      - google-chrome
-    packages:
-      - google-chrome-stable
-  firefox: latest
-
-dart:
-  - dev
-
-before_install:
-  - export CHROMEDRIVER_BINARY=/usr/bin/google-chrome
-  - export CHROMEDRIVER_ARGS=--no-sandbox
-  - /usr/bin/google-chrome --version
-  - firefox --version
-
-  - export DISPLAY=:99.0
-  - sh -e /etc/init.d/xvfb start
-
-before_script:
-  - wget http://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip
-  - unzip chromedriver_linux64.zip
-  - export PATH=$PATH:$PWD
-  - wget https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz
-  - tar -xvzf geckodriver-v0.21.0-linux64.tar.gz
-  - export PATH=$PATH:$PWD
-  - ./tool/travis-setup.sh
-
-script:
-  - ./tool/travis.sh
-
-# Only building master means that we don't run two builds for each pull request.
-branches:
-  only: [master]
-
-cache:
- directories:
-   - $HOME/.pub-cache
diff --git a/README.md b/README.md
index 70f8be9..1459d4e 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,8 @@
-[![Build Status](https://travis-ci.org/google/webdriver.dart.svg?branch=master)](https://travis-ci.org/google/webdriver.dart)
 [![pub package](https://img.shields.io/pub/v/webdriver.svg)](https://pub.dartlang.org/packages/webdriver)
 
 Provides WebDriver bindings for Dart. These use the WebDriver JSON interface,
 and as such, require the use of the WebDriver remote server.
 
-
 In your Dart code, you can use:
 
 ```dart
diff --git a/tool/travis-setup.sh b/tool/travis-setup.sh
deleted file mode 100755
index e5211c5..0000000
--- a/tool/travis-setup.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-# Copyright 2017 Google Inc. All Rights Reserved.
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Fast fail the script on failures.
-set -e
-
-pub get
diff --git a/tool/travis.sh b/tool/travis.sh
deleted file mode 100755
index 14d05e4..0000000
--- a/tool/travis.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/bash
-
-# Copyright 2013 Google Inc. All Rights Reserved.
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-STATUS=0
-
-# Analyze package.
-dartanalyzer .
-ANALYSIS_STATUS=$?
-if [[ $ANALYSIS_STATUS -ne 0 ]]; then
-  STATUS=$ANALYSIS_STATUS
-fi
-
-# Start chromedriver.
-chromedriver --port=4444 --url-base=wd/hub &
-PIDC=$!
-
-# Start geckodriver (Firefox).
-geckodriver --port=4445 &
-PIDG=$!
-
-# Run tests.
-pub run test -r expanded -p vm -j 1
-TEST_STATUS=$?
-if [[ $TEST_STATUS -ne 0 ]]; then
-  STATUS=$TEST_STATUS
-fi
-
-# Exit chromedriver and geckodriver.
-kill $PIDC
-kill $PIDG
-
-exit $STATUS