From a76cbed94bc367f55c54813bae9baa3d4237c871 Mon Sep 17 00:00:00 2001 From: Daniel Mart? Date: Sun, 6 Oct 2019 19:24:03 +0000 Subject: [PATCH] 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 --- .gitattributes | 2 ++ .github/workflows/test.yml | 22 ++++++++++++++++++++ README.md | 1 - cloudbuild.yaml | 4 ---- cmd/cue/cmd/testdata/script/cmd_echo.txt | 4 +--- cmd/cue/cmd/testdata/script/cmd_run.txt | 5 +---- cmd/cue/cmd/testdata/script/cmd_run_list.txt | 5 +---- 7 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 .gitattributes create mode 100644 .github/workflows/test.yml delete mode 100644 cloudbuild.yaml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..6f9522992 --- /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 000000000..7756297f1 --- /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 b937228cd..c04d415cf 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 54158faeb..000000000 --- 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 c47fa89b5..9f76b2e3e 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 51abff7f0..1da20f17a 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 66681e204..16a5b1ca0 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 -- 2.51.2