Skip to content

Commit

Permalink
change config
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyenought committed Jul 17, 2024
1 parent 93de1d9 commit 71b1711
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 43 deletions.
57 changes: 20 additions & 37 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,35 @@ jobs:
- uses: actions/checkout@v3

- name: Check License Header
uses: apache/skywalking-eyes/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: apache/skywalking-eyes/header@501a28d2fb4a9b962661987e50cf0219631b32ff

- name: Check Spell
- name: typos-action
uses: crate-ci/typos@master

staticcheck:
runs-on: [ self-hosted, X64 ]
resolve-modules:
name: resolve module
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
- name: Checkout Repo
uses: actions/checkout@v3

- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: reviewdog-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
reviewdog-${{ runner.os }}-go-
- uses: reviewdog/action-staticcheck@v1
with:
github_token: ${{ secrets.github_token }}
# Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review].
reporter: github-pr-review
# Report all results.
filter_mode: nofilter
# Exit with 1 when it find at least one finding.
fail_on_error: true
# Set staticcheck flags
staticcheck_flags: -checks=inherit,-SA1029
- id: set-matrix
run: ./hack/resolve-modules.sh

lint:
runs-on: [ self-hosted, X64 ]
name: lint module
runs-on: ubuntu-latest
needs: resolve-modules
strategy:
matrix: ${{ fromJson(needs.resolve-modules.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"

- name: Golangci Lint
# https://golangci-lint.run/
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
working-directory: ${{ matrix.workdir }}
args: -E gofumpt --timeout 10m
skip-pkg-cache: true
11 changes: 5 additions & 6 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@
run:
# include `vendor` `third_party` `testdata` `examples` `Godeps` `builtin`
skip-dirs-use-default: true
skip-dirs:
- kitex_gen
skip-files:
- ".*\\.mock\\.go$"
# output configuration options
output:
# Format: colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
format: colored-line-number
formats: colored-line-number
# All available settings of specific linters.
# Refer to https://golangci-lint.run/usage/linters
linters-settings:
Expand All @@ -30,8 +26,11 @@ linters:
disable:
- errcheck
- typecheck
- deadcode
- varcheck
- staticcheck
issues:
exclude-use-default: true
exclude-files:
- ".*\\.mock\\.go$"
exclude-dirs:
- kitex_gen

0 comments on commit 71b1711

Please sign in to comment.