Add CI.
This commit is contained in:
parent
2223ccf8a5
commit
824ac43a4c
1 changed files with 42 additions and 0 deletions
42
.github/workflows/ci.yml
vendored
Normal file
42
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
format:
|
||||||
|
name: Format (gofmt)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
- uses: actions/setup-go@master
|
||||||
|
with:
|
||||||
|
go-version: '1.13'
|
||||||
|
- name: gofmt
|
||||||
|
run: test -z $(gofmt -l .) || (gofmt -d . && exit 1)
|
||||||
|
|
||||||
|
lint:
|
||||||
|
name: Lint (golangci-lint)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [format]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
- uses: actions/setup-go@master
|
||||||
|
with:
|
||||||
|
go-version: '1.13'
|
||||||
|
- name: golangci-lint
|
||||||
|
run: |
|
||||||
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.22.2
|
||||||
|
cd src
|
||||||
|
../bin/golangci-lint run -v ./...
|
||||||
|
|
||||||
|
test:
|
||||||
|
name: Test (go test)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
- uses: actions/setup-go@master
|
||||||
|
with:
|
||||||
|
go-version: '1.13'
|
||||||
|
- name: go test
|
||||||
|
run: go test ./...
|
||||||
Loading…
Add table
Add a link
Reference in a new issue