Update README.md #740
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Backend Workflow | |
on: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.13.x | |
- uses: actions/checkout@v1 | |
- name: Install golangci-lint | |
run: | | |
go get github.com/golangci/golangci-lint/cmd/golangci-lint | |
- name: Run linters | |
run: | | |
export PATH=$PATH:$(go env GOPATH)/bin | |
golangci-lint -E bodyclose,misspell,gocyclo,gofmt,golint,unconvert,goimports,depguard,gocritic,interfacer run | |
test: | |
runs-on: ubuntu-latest | |
services: | |
mariadb: | |
image: mariadb | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
MYSQL_DATABASE: aumo_test | |
ports: | |
- 3306:3306 | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.13.x | |
- uses: actions/checkout@v1 | |
- name: Run tests | |
env: | |
MYSQL_USER: root | |
MYSQL_HOST: localhost | |
MYSQL_DATABASE: aumo_test | |
REDIS_URL_TEST: localhost:6379 | |
REDIS_DATABASE_TEST: 1 | |
run: go test -v -covermode=atomic -race ./tests | |
build: | |
runs-on: ubuntu-latest | |
needs: [lint, test] | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.13.x | |
- uses: actions/checkout@v1 | |
- name: build | |
run: | | |
export GO111MODULE=on | |
GOOS=windows GOARCH=amd64 go build -o bin/ci-test-windows-amd64.exe | |
GOOS=linux GOARCH=amd64 go build -o bin/ci-test-linux-amd64 | |
GOOS=darwin GOARCH=amd64 go build -o bin/ci-test-macos-amd64 |