62 lines
1.6 KiB
YAML
62 lines
1.6 KiB
YAML
name: Lint
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
- release/**
|
|
|
|
jobs:
|
|
golangci:
|
|
name: Run golangci-lint
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: technote-space/get-diff-action@v6.1.2
|
|
with:
|
|
PATTERNS: |
|
|
**/*.go
|
|
- uses: actions/setup-go@v5
|
|
if: env.GIT_DIFF
|
|
with:
|
|
go-version: 1.21.1
|
|
cache: true
|
|
- name: revive lint
|
|
uses: morphy2k/revive-action@v2
|
|
with:
|
|
config: .revive.toml
|
|
exclude: "*.pb.go;*.pb.gw.go;*.pulsar.go;swagger/..."
|
|
path: "./..."
|
|
- name: golangci-lint main
|
|
uses: golangci/golangci-lint-action@v5
|
|
if: env.GIT_DIFF
|
|
with:
|
|
version: latest
|
|
args: --timeout 8m
|
|
- name: golangci-lint pricefeeder
|
|
uses: golangci/golangci-lint-action@v5
|
|
if: ${{ contains(env.GIT_DIFF, 'price-feeder/') }}
|
|
with:
|
|
version: latest
|
|
working-directory: price-feeder
|
|
args: --timeout 8m
|
|
|
|
super-linter:
|
|
name: Run super-linter
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
# Full git history is needed to get a proper list of changed files
|
|
# within `super-linter`.
|
|
fetch-depth: 0
|
|
- name: Run super-linter
|
|
uses: github/super-linter@v6
|
|
env:
|
|
VALIDATE_ALL_CODEBASE: false
|
|
VALIDATE_MARKDOWN: true
|
|
DEFAULT_BRANCH: main
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|