| name: go-lint |
| on: |
| push: |
| branches: |
| - master |
| paths-ignore: |
| - 'docs/**' |
| - 'web/**' |
| pull_request: |
| branches: |
| - master |
| paths-ignore: |
| - 'docs/**' |
| - 'web/**' |
| |
| jobs: |
| golangci: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v2 |
| |
| - name: run lint |
| run: make go-lint |
| |
| gofmt: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v2 |
| - name: setup go |
| uses: actions/setup-go@v1 |
| with: |
| go-version: '1.13' |
| - name: check gofmt |
| working-directory: ./api |
| run: | |
| diffs=`gofmt -l .` |
| if [[ -n $diffs ]]; then |
| echo "Files are not formatted by gofmt:" |
| echo $diffs |
| exit 1 |
| fi |