2020-11-23 05:50:29 +08:00
|
|
|
name: Lint
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-05-12 12:26:16 +08:00
|
|
|
- 2.*
|
2020-11-23 05:50:29 +08:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-05-12 12:26:16 +08:00
|
|
|
- 2.*
|
2020-11-23 05:50:29 +08:00
|
|
|
|
2022-11-06 16:01:36 +08:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-11-23 05:50:29 +08:00
|
|
|
jobs:
|
|
|
|
# From https://github.com/golangci/golangci-lint-action
|
|
|
|
golangci:
|
2022-11-06 16:01:36 +08:00
|
|
|
permissions:
|
|
|
|
contents: read # for actions/checkout to fetch code
|
|
|
|
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
|
2020-11-23 05:50:29 +08:00
|
|
|
name: lint
|
2022-07-27 21:27:18 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-07-22 12:00:48 +08:00
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- macos-latest
|
|
|
|
- windows-latest
|
2022-07-27 21:27:18 +08:00
|
|
|
runs-on: ${{ matrix.os }}
|
2020-11-23 05:50:29 +08:00
|
|
|
steps:
|
2022-03-16 06:09:19 +08:00
|
|
|
- uses: actions/checkout@v3
|
2023-04-02 12:36:16 +08:00
|
|
|
- uses: actions/setup-go@v4
|
2022-03-16 06:09:19 +08:00
|
|
|
with:
|
2023-07-22 12:00:48 +08:00
|
|
|
go-version: '~1.20.6'
|
2022-04-14 04:03:38 +08:00
|
|
|
check-latest: true
|
2022-03-16 06:09:19 +08:00
|
|
|
|
2023-07-22 12:00:48 +08:00
|
|
|
# Workaround for https://github.com/golangci/golangci-lint-action/issues/135
|
|
|
|
skip-pkg-cache: true
|
|
|
|
|
2020-11-23 05:50:29 +08:00
|
|
|
- name: golangci-lint
|
2022-03-16 06:09:19 +08:00
|
|
|
uses: golangci/golangci-lint-action@v3
|
2020-11-23 05:50:29 +08:00
|
|
|
with:
|
2023-07-22 12:00:48 +08:00
|
|
|
version: v1.53
|
|
|
|
|
|
|
|
# Workaround for https://github.com/golangci/golangci-lint-action/issues/135
|
|
|
|
skip-pkg-cache: true
|
|
|
|
|
2022-08-24 04:26:19 +08:00
|
|
|
# Windows times out frequently after about 5m50s if we don't set a longer timeout.
|
|
|
|
args: --timeout 10m
|
2023-07-22 12:00:48 +08:00
|
|
|
|
2020-11-23 05:50:29 +08:00
|
|
|
# Optional: show only new issues if it's a pull request. The default value is `false`.
|
2022-07-29 20:46:45 +08:00
|
|
|
# only-new-issues: true
|