Unverified Commit ed1b9b65 authored by Psnail's avatar Psnail Committed by GitHub

Create go.yml

parent fc4127d5
name: Go
on:
push:
branches: [ master ]
pull_request:
branches: "*"
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
go_version:
- 1.13
os:
- ubuntu-latest
steps:
- name: Set up Go ${{ matrix.go_version }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go_version }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Cache Go Dependence
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- 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: License Check
run: |
sh before_validate_license.sh
chmod u+x /tmp/tools/license/license-header-checker
go fmt ./... && [[ -z `git status -s` ]]
/tmp/tools/license/license-header-checker -v -a -r -i vendor /tmp/tools/license/license.txt . go && [[ -z `git status -s` ]]
- name: Test
run: go mod vendor && go test $(go list ./... | grep -v vendor | grep -v demo) -coverprofile=coverage.txt -covermode=atomic
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment