Skip to content

Commit cd14d3d

Browse files
committed
tests: finish GitHub Actions CI setup, remove Travis-CI
replace README build status badge, for GitHub Actions
1 parent 500eae6 commit cd14d3d

File tree

7 files changed

+33
-36
lines changed

7 files changed

+33
-36
lines changed

.github/workflows/test.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
GOPATH: "${{github.workspace}}/go"
2626
GOARCH: "${{matrix.goarch}}"
2727
SRCDIR: "go/src/github.com/nsqio/nsq"
28+
GO111MODULE: "on" # only needed up to go-1.12
2829

2930
steps:
3031
- uses: actions/checkout@v2
@@ -40,3 +41,26 @@ jobs:
4041
run: |
4142
cd $SRCDIR
4243
./test.sh
44+
45+
send-coverage:
46+
runs-on: ubuntu-20.04
47+
timeout-minutes: 30
48+
container: "golang:1.15-buster"
49+
env:
50+
GOPATH: "${{github.workspace}}/go"
51+
SRCDIR: "go/src/github.com/nsqio/nsq"
52+
53+
steps:
54+
- uses: actions/checkout@v2
55+
with:
56+
path: ${{env.SRCDIR}}
57+
58+
- name: Install goveralls
59+
run: GO111MODULE=off go get github.com/mattn/goveralls
60+
61+
- name: Send coverage
62+
env:
63+
COVERALLS_TOKEN: ${{secrets.GITHUB_TOKEN}}
64+
run: |
65+
cd $SRCDIR
66+
./coverage.sh --coveralls

.travis.yml

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

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ nsqd: fixed bug in protocol_v2
3131

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

3736
## Submitting Changes
3837

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</ul>
1111
</p>
1212

13-
[![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)
13+
[![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)
1414

1515
**NSQ** is a realtime distributed messaging platform designed to operate at scale, handling
1616
billions of messages per day.

coverage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ push_to_coveralls() {
4141
echo "Pushing coverage statistics to coveralls.io"
4242
# ignore failure to push - it happens
4343
$GOPATH/bin/goveralls -coverprofile="$profile" \
44-
-service=travis-ci \
44+
-service=github \
4545
-ignore="nsqadmin/bindata.go" || true
4646
}
4747

test.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
set -e
33

44
GOMAXPROCS=1 go test -timeout 90s ./...
5-
GOMAXPROCS=4 go test -timeout 90s -race ./...
5+
6+
if [ amd64 == "$GOARCH" ] || [ arm64 == "$GOARCH" ]; then
7+
# go test: -race is only supported on linux/amd64, linux/ppc64le,
8+
# linux/arm64, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64
9+
GOMAXPROCS=4 go test -timeout 90s -race ./...
10+
fi
611

712
# no tests, but a build is something
813
for dir in apps/*/ bench/*/; do

travis.sh

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

0 commit comments

Comments
 (0)