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