Skip to content

Commit

Permalink
tests: finish GitHub Actions CI setup, remove Travis-CI
Browse files Browse the repository at this point in the history
replace README build status badge, for GitHub Actions
  • Loading branch information
ploxiln committed Nov 7, 2020
1 parent 500eae6 commit cd14d3d
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 36 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
GOPATH: "${{github.workspace}}/go"
GOARCH: "${{matrix.goarch}}"
SRCDIR: "go/src/github.com/nsqio/nsq"
GO111MODULE: "on" # only needed up to go-1.12

steps:
- uses: actions/checkout@v2
Expand All @@ -40,3 +41,26 @@ jobs:
run: |
cd $SRCDIR
./test.sh
send-coverage:
runs-on: ubuntu-20.04
timeout-minutes: 30
container: "golang:1.15-buster"
env:
GOPATH: "${{github.workspace}}/go"
SRCDIR: "go/src/github.com/nsqio/nsq"

steps:
- uses: actions/checkout@v2
with:
path: ${{env.SRCDIR}}

- name: Install goveralls
run: GO111MODULE=off go get github.com/mattn/goveralls

- name: Send coverage
env:
COVERALLS_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
cd $SRCDIR
./coverage.sh --coveralls
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ nsqd: fixed bug in protocol_v2

* if you're fixing a bug or adding functionality it probably makes sense to write a test
* make sure to run `fmt.sh` and `test.sh` in the root of the repo to ensure that your code is
properly formatted and that tests pass (NOTE: we integrate Travis with GitHub for continuous
integration)
properly formatted and that tests pass (we use GitHub Actions for continuous integration)

## Submitting Changes

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</ul>
</p>

[![Build Status](https://secure.travis-ci.org/nsqio/nsq.svg?branch=master)](http://travis-ci.org/nsqio/nsq) [![GitHub release](https://img.shields.io/github/release/nsqio/nsq.svg)](https://github.com/nsqio/nsq/releases/latest) [![Coverage Status](https://coveralls.io/repos/github/nsqio/nsq/badge.svg?branch=master)](https://coveralls.io/github/nsqio/nsq?branch=master)
[![Build Status](https://github.com/nsqio/nsq/workflows/tests/badge.svg)](https://github.com/nsqio/nsq/actions) [![GitHub release](https://img.shields.io/github/release/nsqio/nsq.svg)](https://github.com/nsqio/nsq/releases/latest) [![Coverage Status](https://coveralls.io/repos/github/nsqio/nsq/badge.svg?branch=master)](https://coveralls.io/github/nsqio/nsq?branch=master)

**NSQ** is a realtime distributed messaging platform designed to operate at scale, handling
billions of messages per day.
Expand Down
2 changes: 1 addition & 1 deletion coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ push_to_coveralls() {
echo "Pushing coverage statistics to coveralls.io"
# ignore failure to push - it happens
$GOPATH/bin/goveralls -coverprofile="$profile" \
-service=travis-ci \
-service=github \
-ignore="nsqadmin/bindata.go" || true
}

Expand Down
7 changes: 6 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
set -e

GOMAXPROCS=1 go test -timeout 90s ./...
GOMAXPROCS=4 go test -timeout 90s -race ./...

if [ amd64 == "$GOARCH" ] || [ arm64 == "$GOARCH" ]; then
# go test: -race is only supported on linux/amd64, linux/ppc64le,
# linux/arm64, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64
GOMAXPROCS=4 go test -timeout 90s -race ./...
fi

# no tests, but a build is something
for dir in apps/*/ bench/*/; do
Expand Down
15 changes: 0 additions & 15 deletions travis.sh

This file was deleted.

0 comments on commit cd14d3d

Please sign in to comment.