Skip to content

Commit c4e81d8

Browse files
committed
github: add static-checks workflow
The static-checks workflow is meant to trigger jobs on pull requests (or manually) to run static checkers (e.g. golangci-lint, commit check, etc) against the project. Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
1 parent 48aa973 commit c4e81d8

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/go-checks.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Run static checkers on the Go sources of the project.
2+
---
3+
name: go-check
4+
5+
on:
6+
pull_request:
7+
paths:
8+
- '**.go'
9+
- 'go.mod'
10+
- 'go.sum'
11+
- '.golangci.yml'
12+
- '.github/workflows/static-checks.yaml'
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: true
18+
19+
permissions: {}
20+
21+
jobs:
22+
golangci-lint:
23+
name: golangci-lint
24+
runs-on: ubuntu-24.04
25+
permissions:
26+
contents: read
27+
steps:
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
with:
30+
persist-credentials: false
31+
submodules: true
32+
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
33+
with:
34+
go-version-file: 'go.mod'
35+
cache-dependency-path: 'go.sum'
36+
cache: true
37+
- name: Generate code
38+
run: make generate
39+
- name: golangci-lint
40+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
41+
with:
42+
version: v2.11.3
43+

0 commit comments

Comments
 (0)