Skip to content

Commit 025e029

Browse files
committed
core: add golangci-lint workflow
1 parent d41c261 commit 025e029

1 file changed

Lines changed: 15 additions & 23 deletions

File tree

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,43 @@
11
---
2-
name: golangci-lint-reusable
2+
name: golangci-lint
33

44
on:
5-
workflow_call:
6-
inputs:
7-
os:
8-
description: 'OS'
9-
required: true
10-
type: string
11-
go-version:
12-
description: 'Go version'
13-
required: true
14-
type: string
15-
default: stable
16-
golangci-lint-version:
17-
description: 'Golangci-lint version'
18-
type: string
19-
default: 'v2.4.0'
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
- master
10+
11+
env:
12+
GO_VERSION: stable
13+
GOLANGCI_LINT_VERSION: v2.4.0
2014

2115
jobs:
2216
detect-modules:
23-
runs-on: ${{ inputs.os }}
17+
runs-on: ubuntu-latest
2418
outputs:
2519
modules: ${{ steps.set-modules.outputs.modules }}
2620
steps:
2721
- uses: actions/checkout@v4
2822
- uses: actions/setup-go@v5
2923
with:
30-
go-version: ${{ inputs.go-version }}
24+
go-version: ${{ env.GO_VERSION }}
3125
- id: set-modules
32-
# required for Windows to be able to use $GITHUB_OUTPUT https://github.com/actions/runner/issues/2224
33-
shell: bash
3426
run: echo "modules=$(go list -m -json | jq -s '.' | jq -c '[.[].Dir]')" >> $GITHUB_OUTPUT
3527

3628
golangci-lint:
3729
needs: detect-modules
38-
runs-on: ${{ inputs.os }}
30+
runs-on: ubuntu-latest
3931
strategy:
4032
matrix:
4133
modules: ${{ fromJSON(needs.detect-modules.outputs.modules) }}
4234
steps:
4335
- uses: actions/checkout@v4
4436
- uses: actions/setup-go@v5
4537
with:
46-
go-version: ${{ inputs.go-version }}
38+
go-version: ${{ env.GO_VERSION }}
4739
- name: golangci-lint ${{ matrix.modules }}
4840
uses: golangci/golangci-lint-action@v8
4941
with:
50-
version: ${{ inputs.golangci-lint-version }}
42+
version: ${{ env.GOLANGCI_LINT_VERSION }}
5143
working-directory: ${{ matrix.modules }}

0 commit comments

Comments
 (0)