mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-04 12:52:27 +08:00
51 lines
1.1 KiB
YAML
51 lines
1.1 KiB
YAML
name: Go
|
|
|
|
on:
|
|
push:
|
|
branches: [ master,release-* ]
|
|
pull_request:
|
|
branches: [ master,release-* ]
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
redis:
|
|
image: redis
|
|
ports:
|
|
- 6379:6379
|
|
options: --entrypoint redis-server
|
|
memcached:
|
|
image: memcached
|
|
ports:
|
|
- 11211:11211
|
|
steps:
|
|
|
|
- name: Set up Go 1.x
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ^1.13
|
|
id: go
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Get dependencies
|
|
run: |
|
|
go get -v -t -d ./...
|
|
if [ -f Gopkg.toml ]; then
|
|
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
|
dep ensure
|
|
fi
|
|
|
|
- name: Lint Go Code
|
|
run: |
|
|
export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14
|
|
go get -u golang.org/x/lint/golint
|
|
go vet ./...
|
|
golint -set_exit_status $(go list ./...)
|
|
|
|
- name: Test
|
|
run: go test -v -race ./...
|