Skip to content

Commit

Permalink
tests: use GitHub Actions for CI
Browse files Browse the repository at this point in the history
also add go-1.14 and go-1.15 to test matrix

keep Travis-CI temporarily
  • Loading branch information
ploxiln committed Nov 6, 2020
1 parent f7c6ac3 commit 3282dc1
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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.12-buster"
- "golang:1.13-buster"
- "golang:1.14-buster"
- "golang:1.15-buster"
goarch:
- "amd64"
- "386"

container: "${{matrix.imgtag}}"
env:
GOPATH: "${{github.workspace}}/go"
GOARCH: "${{matrix.goarch}}"
SRCDIR: "go/src/github.com/nsqio/nsq"

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

- name: build
run: |
cd $SRCDIR
make all
- name: test
run: |
cd $SRCDIR
./test.sh
7 changes: 6 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/sh
set -e

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

Expand All @@ -15,3 +14,9 @@ for dir in apps/*/ bench/*/; do
echo "(skipped $dir)"
fi
done

FMTDIFF="$(find apps internal nsqd nsqlookupd -name '*.go' -exec gofmt -d '{}' ';')"
if [ -n "$FMTDIFF" ]; then
printf '%s\n' "$FMTDIFF"
exit 1
fi

0 comments on commit 3282dc1

Please sign in to comment.