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