mirror of
https://github.com/mgechev/revive.git
synced 2025-10-08 22:41:54 +02:00
67 lines
1.5 KiB
YAML
67 lines
1.5 KiB
YAML
name: Lint
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
|
|
jobs:
|
|
go-mod:
|
|
name: Check go.mod
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: stable
|
|
- name: Check go.mod
|
|
run: |
|
|
go mod tidy
|
|
git diff --exit-code go.mod
|
|
git diff --exit-code go.sum
|
|
|
|
gofmt:
|
|
name: Check unformatted Go code
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: stable
|
|
- name: Run gofmt
|
|
run: |
|
|
find . -type f -name '*.go' -not -path './testdata/*' -exec gofmt -w {} +
|
|
git diff --exit-code
|
|
|
|
lint-go:
|
|
name: Lint Go
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go and register problem matcher
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: stable
|
|
|
|
- name: Install revive
|
|
run: go install
|
|
|
|
- name: Run revive
|
|
run: revive --config revive.toml ./...
|
|
|
|
- name: Run golangci-lint
|
|
uses: golangci/golangci-lint-action@v8
|
|
with:
|
|
version: v2.1.6
|
|
|
|
lint-md:
|
|
name: Lint Markdown
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: DavidAnson/markdownlint-cli2-action@v20
|
|
with:
|
|
config: .markdownlint-cli2.yaml
|