Skip to content

Commit 1104d96

Browse files
thaJeztahjeffwidman
authored andcommitted
gha: add golangci-lint
Linting is disabled on Windows, as the current build-tags do not properly exclude non-unix platforms; level=info msg="[runner/filename_unadjuster] Pre-built 0 adjustments in 1.0348ms" Error: level=error msg="[linters_context] typechecking error: D:\\a\\netns\\netns\\netns.go:28:18: Stat_t not declared by package unix" Error: level=error msg="[linters_context] typechecking error: D:\\a\\netns\\netns\\netns.go:29:17: Fstat not declared by package unix" Error: level=error msg="[linters_context] typechecking error: D:\\a\\netns\\netns\\netns.go:32:17: Fstat not declared by package unix" Error: level=error msg="[linters_context] typechecking error: D:\\a\\netns\\netns\\netns.go:43:13: Stat_t not declared by package unix" Error: level=error msg="[linters_context] typechecking error: D:\\a\\netns\\netns\\netns.go:44:17: Fstat not declared by package unix" Error: level=error msg="[linters_context] typechecking error: D:\\a\\netns\\netns\\netns.go:56:13: Stat_t not declared by package unix" Error: level=error msg="[linters_context] typechecking error: D:\\a\\netns\\netns\\netns.go:57:17: Fstat not declared by package unix" Error: level=error msg="[linters_context] typechecking error: D:\\a\\netns\\netns\\netns.go:71:17: Close not declared by package unix" Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 4ed9170 commit 1104d96

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

Diff for: .github/workflows/validate.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: validate
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- master
8+
- main
9+
pull_request:
10+
branches:
11+
- master
12+
- main
13+
14+
jobs:
15+
linters:
16+
permissions:
17+
contents: read # for actions/checkout to fetch code
18+
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
19+
timeout-minutes: 10
20+
21+
strategy:
22+
matrix:
23+
# We only run on the latest version of go, as some linters may be
24+
# version-dependent (for example gofmt can change between releases).
25+
go-version: [stable]
26+
os: [ubuntu-22.04, windows-2022]
27+
runs-on: ${{ matrix.os }}
28+
steps:
29+
- name: Install Go
30+
uses: actions/setup-go@v3
31+
with:
32+
go-version: ${{ matrix.go-version }}
33+
- name: Checkout code
34+
uses: actions/checkout@v3
35+
- name: Lint
36+
uses: golangci/golangci-lint-action@v3
37+
with:
38+
version: latest
39+
skip-cache: true
40+
args: --print-resources-usage --verbose
41+
42+
# Optional: show only new issues if it's a pull request. The default value is `false`.
43+
# only-new-issues: true
44+
45+
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
46+
# skip-pkg-cache: true
47+
48+
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
49+
# skip-build-cache: true

Diff for: .golangci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
run:
2+
timeout: 5m

0 commit comments

Comments
 (0)