diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..ad24de8b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,49 @@ +name: tests + +on: + push: {branches: [master]} + pull_request: {branches: [master]} + +jobs: + test: + runs-on: ubuntu-20.04 + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + imgtag: + - "golang:1.15-buster" + - "golang:1.16-buster" + - "golang:1.17-buster" + goarch: + - "amd64" + nsq_ver: + - "nsq-1.1.0.linux-amd64.go1.10.3" + - "nsq-1.2.0.linux-amd64.go1.12.9" + - "nsq-1.2.1.linux-amd64.go1.16.6" + include: + # test 386 only against latest version of NSQ + - imgtag: "golang:1.17-buster" + goarch: "386" + nsq_ver: "nsq-1.2.1.linux-amd64.go1.16.6" + + container: "${{matrix.imgtag}}" + env: + GOPATH: "${{github.workspace}}/go" + GOARCH: "${{matrix.goarch}}" + SRCDIR: "go/src/github.com/nsqio/go-nsq" + + steps: + - uses: actions/checkout@v2 + with: + path: ${{env.SRCDIR}} + + - name: download NSQ + run: | + curl -sSL "http://bitly-downloads.s3.amazonaws.com/nsq/${{matrix.nsq_ver}}.tar.gz" \ + | tar -xzv --strip-components=1 + + - name: test + run: | + export PATH=bin:$PATH + ./test.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 304d3db7..00000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: go -go: - # test with the two most recent Go versions - - 1.12.x - - 1.13.x -env: - - NSQ_DOWNLOAD=nsq-1.0.0-compat.linux-amd64.go1.8 GOARCH=amd64 - - NSQ_DOWNLOAD=nsq-1.1.0.linux-amd64.go1.10.3 GOARCH=amd64 - - NSQ_DOWNLOAD=nsq-1.2.0.linux-amd64.go1.12.9 GOARCH=amd64 - # test most recent nsq version on GOARCH=386 - - NSQ_DOWNLOAD=nsq-1.2.0.linux-amd64.go1.12.9 GOARCH=386 -script: - - ./travis.sh -notifications: - email: false -sudo: false diff --git a/travis.sh b/travis.sh deleted file mode 100755 index ead70a08..00000000 --- a/travis.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -set -e - -wget http://bitly-downloads.s3.amazonaws.com/nsq/$NSQ_DOWNLOAD.tar.gz -tar zxvf $NSQ_DOWNLOAD.tar.gz -export PATH=$NSQ_DOWNLOAD/bin:$PATH - -export GO111MODULE=on -./test.sh