start using GitHub Actions as CI

For now, this tests on Ubuntu, MacOS, and Windows, both on the latest Go
1.12 and 1.13. We run the tests both with and without -race.

Three tests needed updating, since they exec the system's "echo" binary.
On Windows, that may use CRLF line endings, which happened on GitHub
Actions. To fix that, match the output with a line regular expression,
instead of via an entire stdout file with LF line endings.

Finally, remove the AppVeyor badge and cloudbuild file, as we won't be
needing those anymore.

Fixes #144.

Closes #147
https://github.com/cuelang/cue/pull/147

GitOrigin-RevId: 869bf85317e078c9a981d585e7896c17452a7827
Change-Id: Ibdb89d7b73c9323dd9627edfdf791d7a3ac42bd2
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/3543
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..6f95229
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+# To prevent CRLF breakages on Windows for fragile files, like testdata.
+* -text
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..7756297
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,22 @@
+on: [push, pull_request]
+name: Test
+
+jobs:
+  test:
+    strategy:
+      matrix:
+        go-version: [1.12.x, 1.13.x]
+        platform: [ubuntu-latest, macos-latest, windows-latest]
+    runs-on: ${{ matrix.platform }}
+    steps:
+    - name: Install Go
+      uses: actions/setup-go@v1
+      with:
+        go-version: ${{ matrix.go-version }}
+    - name: Checkout code
+      uses: actions/checkout@v1
+
+    - name: Test
+      run: go test ./...
+    - name: Test with -race
+      run: go test -race ./...
diff --git a/README.md b/README.md
index b937228..c04d415 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,6 @@
  limitations under the License.
 -->
 [![GoDoc](https://godoc.org/cuelang.org/go?status.svg)](https://godoc.org/cuelang.org/go)
-[![Appveyor](https://ci.appveyor.com/api/projects/status/0v3ec7p5162hpwpe?svg=true)](https://ci.appveyor.com/project/mpvl/cue)
 [![Go Report Card](https://goreportcard.com/badge/github.com/cuelang/cue)](https://goreportcard.com/report/github.com/cuelang/cue)
 [![Go 1.12](https://img.shields.io/badge/go-1.12-9cf.svg)](https://golang.org/dl/)
 [![platforms](https://img.shields.io/badge/platforms-linux|windows|macos-inactive.svg)]()
diff --git a/cloudbuild.yaml b/cloudbuild.yaml
deleted file mode 100644
index 54158fa..0000000
--- a/cloudbuild.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-steps:
-- name: golang:1.12
-  env: ['GO111MODULE=on']
-  args: ['go', 'test', './...', '-race' ]
diff --git a/cmd/cue/cmd/testdata/script/cmd_echo.txt b/cmd/cue/cmd/testdata/script/cmd_echo.txt
index c47fa89..9f76b2e 100644
--- a/cmd/cue/cmd/testdata/script/cmd_echo.txt
+++ b/cmd/cue/cmd/testdata/script/cmd_echo.txt
@@ -1,7 +1,5 @@
 cue cmd echo
-cmp stdout expect-stdout
--- expect-stdout --
-Hello World!
+stdout 'Hello World!'
 
 -- data.cue --
 package hello
diff --git a/cmd/cue/cmd/testdata/script/cmd_run.txt b/cmd/cue/cmd/testdata/script/cmd_run.txt
index 51abff7..1da20f1 100644
--- a/cmd/cue/cmd/testdata/script/cmd_run.txt
+++ b/cmd/cue/cmd/testdata/script/cmd_run.txt
@@ -1,8 +1,5 @@
 cue cmd run
-cmp stdout run.out
-
--- run.out --
-Hello world!
+stdout 'Hello world!'
 
 -- task.cue --
 package home
diff --git a/cmd/cue/cmd/testdata/script/cmd_run_list.txt b/cmd/cue/cmd/testdata/script/cmd_run_list.txt
index 66681e2..16a5b1c 100644
--- a/cmd/cue/cmd/testdata/script/cmd_run_list.txt
+++ b/cmd/cue/cmd/testdata/script/cmd_run_list.txt
@@ -1,8 +1,5 @@
 cue cmd run_list
-cmp stdout run_list.out
-
--- run_list.out --
-Hello world!
+stdout 'Hello world!'
 
 -- task.cue --
 package home