2020-09-09 18:19:49 +08:00
|
|
|
name: Linter
|
2020-06-19 21:19:37 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-11-23 20:51:58 +08:00
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- v*
|
2020-09-16 22:00:52 +08:00
|
|
|
paths:
|
|
|
|
- "**/*.go"
|
2021-02-24 14:22:37 +08:00
|
|
|
- ".github/workflows/linter.yml"
|
2020-06-19 21:19:37 +08:00
|
|
|
pull_request:
|
2020-08-25 00:04:31 +08:00
|
|
|
types: [opened, synchronize, reopened]
|
2020-09-16 22:00:52 +08:00
|
|
|
paths:
|
|
|
|
- "**/*.go"
|
2021-02-24 14:22:37 +08:00
|
|
|
- ".github/workflows/linter.yml"
|
2020-06-19 21:19:37 +08:00
|
|
|
|
|
|
|
jobs:
|
2020-08-24 16:09:51 +08:00
|
|
|
lint:
|
2021-06-22 22:36:23 +08:00
|
|
|
if: github.repository == 'v2fly/v2ray-core'
|
2020-06-19 21:19:37 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-08-31 01:09:45 +08:00
|
|
|
- name: Set up Go 1.x
|
2022-04-09 17:41:11 +08:00
|
|
|
uses: actions/setup-go@v3
|
2020-08-31 01:09:45 +08:00
|
|
|
with:
|
2022-03-27 01:43:02 +08:00
|
|
|
go-version: ^1.18
|
2020-08-31 01:09:45 +08:00
|
|
|
|
|
|
|
- name: Checkout codebase
|
2022-03-02 13:10:12 +08:00
|
|
|
uses: actions/checkout@v3
|
2020-06-19 21:19:37 +08:00
|
|
|
|
2020-09-09 17:50:36 +08:00
|
|
|
- name: golangci-lint
|
2022-02-25 10:01:58 +08:00
|
|
|
uses: golangci/golangci-lint-action@v3
|
2020-09-09 17:50:36 +08:00
|
|
|
with:
|
2021-02-24 14:22:37 +08:00
|
|
|
version: latest
|
2020-09-16 15:18:25 +08:00
|
|
|
args: --config=.github/linters/.golangci.yml
|
2020-09-18 16:48:45 +08:00
|
|
|
only-new-issues: true
|