From b5c6a15ca7e41ee057ab68f8c9ab15c029f0318b Mon Sep 17 00:00:00 2001 From: Matt Reiferson Date: Sun, 12 Sep 2021 15:13:27 -0700 Subject: [PATCH] *: switch to github actions --- .github/workflows/test.yml | 49 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 16 ------------- README.md | 2 +- travis.sh | 10 -------- 4 files changed, 50 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml delete mode 100755 travis.sh 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/README.md b/README.md index 55213f2f..326ac497 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## go-nsq -[![Build Status](https://secure.travis-ci.org/nsqio/go-nsq.svg?branch=master)][travis] [![GoDoc](https://godoc.org/github.com/nsqio/go-nsq?status.svg)](https://godoc.org/github.com/nsqio/go-nsq) [![GitHub release](https://img.shields.io/github/release/nsqio/go-nsq.svg)](https://github.com/nsqio/go-nsq/releases/latest) +[![Build Status](https://github.com/nsqio/go-nsq/workflows/tests/badge.svg)](https://github.com/nsqio/go-nsq/actions) [![GoDoc](https://godoc.org/github.com/nsqio/go-nsq?status.svg)](https://godoc.org/github.com/nsqio/go-nsq) [![GitHub release](https://img.shields.io/github/release/nsqio/go-nsq.svg)](https://github.com/nsqio/go-nsq/releases/latest) The official Go package for [NSQ][nsq]. 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