Skip to content

Commit 1115b6a

Browse files
committed
testscript: support Go 1.16, move to Actions
https://go-review.googlesource.com/c/go/+/250977 adds a new method to the testing.testDeps interface, so mirror that here in our no-op implementation too. While at it, replace Travis with GitHub Actions, which is faster and easier to use. We still test on Linux, Mac, and Windows, and with the two latest Go versions. Otherwise, the config is a straight port, and we run the same commands.
1 parent bb90167 commit 1115b6a

File tree

4 files changed

+35
-41
lines changed

4 files changed

+35
-41
lines changed

.github/workflows/test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
on: [push, pull_request]
2+
name: Test
3+
jobs:
4+
test:
5+
strategy:
6+
matrix:
7+
go-version: [1.14.x, 1.15.x]
8+
os: [ubuntu-latest, macos-latest, windows-latest]
9+
runs-on: ${{ matrix.os }}
10+
steps:
11+
- name: Install Go
12+
uses: actions/setup-go@v2
13+
with:
14+
go-version: ${{ matrix.go-version }}
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
- name: Test
18+
run: |
19+
go test ./...
20+
go test -race ./...
21+
22+
- name: Tidy
23+
if: matrix.os == 'ubuntu-latest' # no need to do this everywhere
24+
run: |
25+
go mod tidy
26+
27+
test -z "$(gofmt -d .)" || (gofmt -d . && false)
28+
test -z "$(git status --porcelain)" || (git status; git diff && false)

.travis.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

testscript/exe.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,6 @@ func (nopTestDeps) WriteHeapProfile(io.Writer) error {
211211
// Not needed for Go 1.10.
212212
return nil
213213
}
214+
215+
// Note: SetPanicOnExit0 was added in Go 1.16.
216+
func (nopTestDeps) SetPanicOnExit0(bool) {}

testscript/testdata/wait.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
[!exec:echo] skip
22
[!exec:false] skip
33

4+
# TODO: the '\n' below doesn't work on Windows on Github Actions, which does
5+
# have coreutils like "echo" installed. Perhaps they emit CRLF?
6+
[windows] skip
7+
48
exec echo foo
59
stdout foo
610

0 commit comments

Comments
 (0)