Skip to content

Commit 564ff06

Browse files
committed
Separate lint + enable on other platforms
Signed-off-by: apostasie <[email protected]>
1 parent dbcc3bc commit 564ff06

File tree

3 files changed

+79
-47
lines changed

3 files changed

+79
-47
lines changed

.github/workflows/lint.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'release/**'
8+
pull_request:
9+
10+
env:
11+
GO_VERSION: 1.23.x
12+
13+
jobs:
14+
go:
15+
timeout-minutes: 5
16+
name: "go | ${{ matrix.goos }} | ${{ matrix.canary }}"
17+
runs-on: "${{ matrix.os }}"
18+
defaults:
19+
run:
20+
shell: bash
21+
strategy:
22+
matrix:
23+
include:
24+
- os: ubuntu-24.04
25+
goos: linux
26+
- os: ubuntu-24.04
27+
goos: freebsd
28+
# FIXME: this is currently failing in a non-sensical way, so, running on linux instead...
29+
# - os: windows-2022
30+
- os: ubuntu-24.04
31+
goos: windows
32+
- os: ubuntu-24.04
33+
goos: linux
34+
# This allows the canary script to select any upcoming golang alpha/beta/RC
35+
canary: go-canary
36+
env:
37+
GOOS: "${{ matrix.goos }}"
38+
steps:
39+
- uses: actions/[email protected]
40+
with:
41+
fetch-depth: 1
42+
- name: Set GO env
43+
run: |
44+
# If canary is specified, get the latest available golang pre-release instead of the major version
45+
if [ "$canary" != "" ]; then
46+
. ./hack/build-integration-canary.sh
47+
canary::golang::latest
48+
fi
49+
- uses: actions/setup-go@v5
50+
with:
51+
go-version: ${{ env.GO_VERSION }}
52+
check-latest: true
53+
cache: true
54+
- name: golangci-lint
55+
uses: golangci/golangci-lint-action@v6
56+
with:
57+
args: --verbose
58+
59+
other:
60+
timeout-minutes: 5
61+
name: yaml | shell | imports order
62+
runs-on: ubuntu-24.04
63+
steps:
64+
- uses: actions/[email protected]
65+
with:
66+
fetch-depth: 1
67+
- uses: actions/setup-go@v5
68+
with:
69+
go-version: ${{ env.GO_VERSION }}
70+
check-latest: true
71+
cache: true
72+
- name: yaml
73+
run: make lint-yaml
74+
- name: shell
75+
run: make lint-shell
76+
- name: go imports ordering
77+
run: |
78+
go install -v github.com/incu6us/goimports-reviser/v3@latest
79+
make lint-imports

.github/workflows/test-canary.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,6 @@ env:
1515
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1616

1717
jobs:
18-
lint:
19-
runs-on: "ubuntu-24.04"
20-
timeout-minutes: 20
21-
steps:
22-
- uses: actions/[email protected]
23-
with:
24-
fetch-depth: 1
25-
- name: Set GO env
26-
run: |
27-
. ./hack/build-integration-canary.sh
28-
canary::golang::latest
29-
- uses: actions/setup-go@v5
30-
with:
31-
go-version: ${{ env.GO_VERSION }}
32-
check-latest: true
33-
cache: true
34-
- name: golangci-lint
35-
uses: golangci/[email protected]
36-
with:
37-
args: --verbose
38-
3918
linux:
4019
runs-on: "ubuntu-24.04"
4120
timeout-minutes: 40

.github/workflows/test.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,6 @@ env:
1313
GO_VERSION: 1.23.x
1414

1515
jobs:
16-
lint:
17-
runs-on: ubuntu-24.04
18-
timeout-minutes: 20
19-
steps:
20-
- uses: actions/[email protected]
21-
with:
22-
fetch-depth: 1
23-
- uses: actions/setup-go@v5
24-
with:
25-
go-version: ${{ env.GO_VERSION }}
26-
check-latest: true
27-
cache: true
28-
- name: golangci-lint
29-
uses: golangci/[email protected]
30-
with:
31-
version: v1.60.1
32-
args: --verbose
33-
- name: yamllint-lint
34-
run: make lint-yaml
35-
- name: shellcheck
36-
run: make lint-shell
37-
- name: go imports ordering
38-
run: |
39-
go install -v github.com/incu6us/goimports-reviser/v3@latest
40-
make lint-imports
41-
4216
test-unit:
4317
timeout-minutes: 5
4418
name: unit | ${{ matrix.goos }}

0 commit comments

Comments
 (0)