2021-12-13 19:23:31 +00:00
|
|
|
name: golangci-lint
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- v*
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
# Optional: allow read access to pull request. Use with `only-new-issues` option.
|
|
|
|
# pull-requests: read
|
|
|
|
jobs:
|
|
|
|
golangci:
|
|
|
|
name: lint
|
2024-07-22 10:43:44 -07:00
|
|
|
runs-on: ubuntu-latest
|
2021-12-13 19:23:31 +00:00
|
|
|
steps:
|
2023-12-12 02:44:28 -08:00
|
|
|
- uses: actions/setup-go@v5
|
2022-04-04 18:04:12 +00:00
|
|
|
with:
|
2023-03-22 12:33:21 -07:00
|
|
|
cache: false
|
2024-03-20 20:53:11 +02:00
|
|
|
go-version: '1.22'
|
2023-09-05 12:30:49 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-28 21:59:52 +03:00
|
|
|
- name: Run linter with GH action
|
2024-05-28 00:37:27 +03:00
|
|
|
uses: golangci/golangci-lint-action@v6
|
2021-12-13 19:23:31 +00:00
|
|
|
with:
|
|
|
|
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
|
2023-10-20 07:27:04 -07:00
|
|
|
version: v1.54.2
|
2021-12-13 19:23:31 +00:00
|
|
|
|
|
|
|
# Optional: working directory, useful for monorepos
|
|
|
|
# working-directory: somedir
|
|
|
|
|
|
|
|
# Optional: golangci-lint command line arguments.
|
|
|
|
# args: --issues-exit-code=0
|
2023-08-02 21:58:34 +03:00
|
|
|
args: --config ./golangcilint.yaml --enable-all --build-tags debug,needprivileges,sync,scrub,search,userprefs,metrics,containers_image_openpgp,lint,mgmt,imagetrust ./cmd/... ./pkg/...
|
2021-12-13 19:23:31 +00:00
|
|
|
|
|
|
|
# Optional: show only new issues if it's a pull request. The default value is `false`.
|
|
|
|
# only-new-issues: true
|
|
|
|
|
|
|
|
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
|
|
|
|
# skip-pkg-cache: true
|
2023-10-30 22:06:04 +02:00
|
|
|
# skip-pkg-cache: false
|
2021-12-13 19:23:31 +00:00
|
|
|
|
|
|
|
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
|
|
|
|
# skip-build-cache: true
|
2023-09-28 21:59:52 +03:00
|
|
|
- name: Run linter from make target
|
|
|
|
run: |
|
|
|
|
make check
|
2023-12-08 00:05:02 -08:00
|
|
|
- name: Run log linter
|
|
|
|
run: |
|
|
|
|
make check-logs
|