all: switch to GitHub actions
Travis-CI is dead. The new hotness if GitHub actions.
For now we only test on Linux since testing on macOS and Windows
takes more effort to figure out.
Change-Id: I464df75b9142dafcdf07281f70c1bcf52514f71a
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/298089
Trust: Joe Tsai <joetsai@digital-static.net>
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..d03f567
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,26 @@
+on: [push]
+name: Test
+jobs:
+ test:
+ strategy:
+ matrix:
+ go-version: [1.16.x]
+ os: [ubuntu-latest] # TODO: Add [macos-latest, windows-latest]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - name: Install Linux dependencies
+ if: runner.os == 'Linux'
+ run: sudo apt-get -y install autoconf automake libtool curl make g++ unzip
+ - name: Install Go
+ uses: actions/setup-go@v2
+ with:
+ go-version: ${{ matrix.go-version }}
+ - name: Checkout code
+ uses: actions/checkout@v2
+ - name: Cache dependencies
+ uses: actions/cache@v2
+ with:
+ path: .cache
+ key: ${{ runner.os }}-${{ hashFiles('integration_test.go') }}
+ - name: Test
+ run: go test -v -mod=vendor -timeout=60m -count=1 integration_test.go -failfast
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index c390ccc..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-language: go
-go: 1.12.x
-install:
- - unset GOROOT
- - unset GOPATH
-matrix:
- include:
- - os: linux
- dist: xenial
- - os: osx
- osx_image: xcode10.1
-script:
- - ./test.bash
-cache:
- directories:
- - .cache
diff --git a/integration_test.go b/integration_test.go
index 67b893a..4587ffb 100644
--- a/integration_test.go
+++ b/integration_test.go
@@ -180,25 +180,6 @@
testDir := filepath.Join(repoRoot, ".cache")
check(os.MkdirAll(testDir, 0775))
- // Travis-CI has a hard-coded timeout where it kills the test after
- // 10 minutes of a lack of activity on stdout.
- // We work around this restriction by periodically printing the timestamp.
- ticker := time.NewTicker(5 * time.Minute)
- done := make(chan struct{})
- go func() {
- now := time.Now()
- for {
- select {
- case t := <-ticker.C:
- fmt.Printf("\tt=%0.fmin\n", t.Sub(now).Minutes())
- case <-done:
- return
- }
- }
- }()
- defer close(done)
- defer ticker.Stop()
-
// Delete the current directory if non-empty,
// which only occurs if a dependency failed to initialize properly.
var workingDir string
@@ -295,7 +276,7 @@
registerBinary("staticcheck", filepath.Join(checkDir, "staticcheck"))
finishWork()
- // Travis-CI sets GOROOT, which confuses invocations of the Go toolchain.
+ // GitHub actions sets GOROOT, which confuses invocations of the Go toolchain.
// Explicitly clear GOROOT, so each toolchain uses their default GOROOT.
check(os.Unsetenv("GOROOT"))