mirror of https://github.com/casbin/casnode.git
feat(ci): add ci to auto format go code (#533)
* feat(ci): add ci to auto format go code * fix: fix ref error * fix: fix ci error * feat: ci check error * feat: show hints * feat: ci
This commit is contained in:
parent
483218cddf
commit
69d6098eb2
|
@ -1,7 +1,10 @@
|
|||
name: Build
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
jobs:
|
||||
|
||||
frontend:
|
||||
|
@ -19,21 +22,36 @@ jobs:
|
|||
name: Back-end
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-go@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '^1.16.5'
|
||||
- run: go version
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
go build -race -ldflags "-extldflags '-static'"
|
||||
working-directory: ./
|
||||
|
||||
linter:
|
||||
name: Go-Linter
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '^1.16.5'
|
||||
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: v1.29
|
||||
args: --disable-all -E gofumpt --max-same-issues=0 --max-issues-per-linter=0 --timeout 5m ./...
|
||||
|
||||
release-and-push:
|
||||
name: Release And Push
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'casbin/casnode' && github.event_name == 'push'
|
||||
needs: [ frontend, backend ]
|
||||
needs: [ frontend, backend, linter ]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
|
Loading…
Reference in New Issue