|
@@ -0,0 +1,40 @@
|
|
|
+name: Lint
|
|
|
+on:
|
|
|
+ push:
|
|
|
+ paths:
|
|
|
+ - '**.go'
|
|
|
+ - 'go.mod'
|
|
|
+ - 'go.sum'
|
|
|
+ - 'tools/check/revive.toml'
|
|
|
+ - '.github/workflows/lint.yaml'
|
|
|
+ pull_request:
|
|
|
+ types: [opened, edited, synchronize, reopened]
|
|
|
+ paths:
|
|
|
+ - '**.go'
|
|
|
+ - 'go.mod'
|
|
|
+ - 'go.sum'
|
|
|
+ - 'tools/check/revive.toml'
|
|
|
+ - '.github/workflows/lint.yaml'
|
|
|
+
|
|
|
+jobs:
|
|
|
+
|
|
|
+ lint:
|
|
|
+ name: Lint
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ steps:
|
|
|
+
|
|
|
+ - name: Set up Go
|
|
|
+ uses: actions/setup-go@v4
|
|
|
+ with:
|
|
|
+ go-version: '1.20'
|
|
|
+
|
|
|
+ - name: Check out code into the Go module directory
|
|
|
+ uses: actions/checkout@v3
|
|
|
+
|
|
|
+ - name: Run Revive Action
|
|
|
+ uses: docker://morphy/revive-action:v2
|
|
|
+ with:
|
|
|
+ config: tools/check/revive.toml
|
|
|
+
|
|
|
+ - name: Check formatting
|
|
|
+ run: test -z $(gofmt -l .) || (gofmt -l . && exit 1)
|