Skip to content

Commit e6ff9ba

Browse files
authored
Merge pull request #3 from grafana/feat-2-init-repo
Initialize repo
2 parents 6336be6 + 8090b1f commit e6ff9ba

File tree

10 files changed

+431
-1
lines changed

10 files changed

+431
-1
lines changed

.github/workflows/lint.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: lint
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
push:
7+
paths-ignore:
8+
- "docs/**"
9+
- README.md
10+
- "releases/**"
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
lint:
17+
name: lint
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- name: Setup go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: "1.21"
26+
cache: false
27+
- name: Go linter
28+
uses: golangci/golangci-lint-action@v3
29+
with:
30+
version: v1.55
31+
args: --timeout=30m
32+
install-mode: binary

.github/workflows/release.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: release
2+
on:
3+
push:
4+
tags:
5+
- "v*"
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- name: Set up Go
18+
uses: actions/setup-go@v5
19+
with:
20+
go-version: "1.21"
21+
- name: Run GoReleaser
22+
uses: goreleaser/goreleaser-action@v5
23+
with:
24+
distribution: goreleaser
25+
version: "1.22.0"
26+
args: release --clean
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
push:
7+
paths-ignore:
8+
- "docs/**"
9+
- README.md
10+
- "releases/**"
11+
12+
jobs:
13+
test:
14+
name: Test
15+
strategy:
16+
matrix:
17+
platform:
18+
- ubuntu-latest
19+
- macos-latest
20+
- windows-latest
21+
runs-on: ${{matrix.platform}}
22+
steps:
23+
- name: Install Go
24+
uses: actions/setup-go@v5
25+
with:
26+
go-version: "1.21"
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Test
31+
run: go test -race -count 1 ./...
32+
33+
- name: Coverage Test
34+
if: ${{ matrix.platform == 'ubuntu-latest' && github.ref_name == 'main' }}
35+
run: go test -count 1 -coverprofile=coverage.txt ./...
36+
37+
- name: Upload Coverage
38+
if: ${{ matrix.platform == 'ubuntu-latest' && github.ref_name == 'main' }}
39+
uses: codecov/[email protected]
40+
with:
41+
token: ${{ secrets.CODECOV_TOKEN }}
42+
slug: grafana/k6pack
43+
44+
- name: Generate Go Report Card
45+
if: ${{ matrix.platform == 'ubuntu-latest' && github.ref_name == 'main' }}
46+
uses: creekorful/[email protected]

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/k6deps
2+
/k6deps.exe
3+
/build

.golangci.yml

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# v1.55.2
2+
# Please don't remove the first line. It uses in CI to determine the golangci version
3+
run:
4+
deadline: 5m
5+
6+
issues:
7+
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
8+
max-issues-per-linter: 0
9+
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
10+
max-same-issues: 0
11+
12+
# We want to try and improve the comments in the k6 codebase, so individual
13+
# non-golint items from the default exclusion list will gradually be added
14+
# to the exclude-rules below
15+
exclude-use-default: false
16+
17+
exclude-rules:
18+
# Exclude duplicate code and function length and complexity checking in test
19+
# files (due to common repeats and long functions in test code)
20+
- path: _(test|gen)\.go
21+
linters:
22+
- cyclop
23+
- dupl
24+
- gocognit
25+
- funlen
26+
- lll
27+
- path: js\/modules\/k6\/http\/.*_test\.go
28+
linters:
29+
# k6/http module's tests are quite complex because they often have several nested levels.
30+
# The module is in maintainance mode, so we don't intend to port the tests to a parallel version.
31+
- paralleltest
32+
- tparallel
33+
- linters:
34+
- staticcheck # Tracked in https://github.com/grafana/xk6-grpc/issues/14
35+
text: "The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated."
36+
- linters:
37+
- forbidigo
38+
text: 'use of `os\.(SyscallError|Signal|Interrupt)` forbidden'
39+
40+
linters-settings:
41+
nolintlint:
42+
# Disable to ensure that nolint directives don't have a leading space. Default is true.
43+
allow-leading-space: false
44+
exhaustive:
45+
default-signifies-exhaustive: true
46+
govet:
47+
check-shadowing: true
48+
cyclop:
49+
max-complexity: 25
50+
maligned:
51+
suggest-new: true
52+
dupl:
53+
threshold: 150
54+
goconst:
55+
min-len: 10
56+
min-occurrences: 4
57+
funlen:
58+
lines: 80
59+
statements: 60
60+
forbidigo:
61+
forbid:
62+
- '^(fmt\\.Print(|f|ln)|print|println)$'
63+
# Forbid everything in os, except os.Signal and os.SyscalError
64+
- '^os\.(.*)$(# Using anything except Signal and SyscallError from the os package is forbidden )?'
65+
# Forbid everything in syscall except the uppercase constants
66+
- '^syscall\.[^A-Z_]+$(# Using anything except constants from the syscall package is forbidden )?'
67+
- '^logrus\.Logger$'
68+
69+
linters:
70+
disable-all: true
71+
enable:
72+
- asasalint
73+
- asciicheck
74+
- bidichk
75+
- bodyclose
76+
- contextcheck
77+
- cyclop
78+
- dogsled
79+
- dupl
80+
- durationcheck
81+
- errcheck
82+
- errchkjson
83+
- errname
84+
- errorlint
85+
- exhaustive
86+
- exportloopref
87+
- forbidigo
88+
- forcetypeassert
89+
- funlen
90+
- gocheckcompilerdirectives
91+
- gochecknoglobals
92+
- gocognit
93+
- goconst
94+
- gocritic
95+
- gofmt
96+
- gofumpt
97+
- goimports
98+
- gomoddirectives
99+
- goprintffuncname
100+
- gosec
101+
- gosimple
102+
- govet
103+
- importas
104+
- ineffassign
105+
- interfacebloat
106+
- lll
107+
- makezero
108+
- misspell
109+
- nakedret
110+
- nestif
111+
- nilerr
112+
- nilnil
113+
- noctx
114+
- nolintlint
115+
- nosprintfhostport
116+
- paralleltest
117+
- prealloc
118+
- predeclared
119+
- promlinter
120+
- revive
121+
- reassign
122+
- rowserrcheck
123+
- sqlclosecheck
124+
- staticcheck
125+
- stylecheck
126+
- tenv
127+
- tparallel
128+
- typecheck
129+
- unconvert
130+
- unparam
131+
- unused
132+
- usestdlibvars
133+
- wastedassign
134+
- whitespace
135+
fast: false

.goreleaser.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
project_name: k6deps
2+
before:
3+
hooks:
4+
- go mod tidy
5+
dist: build/dist
6+
builds:
7+
- env:
8+
- CGO_ENABLED=0
9+
goos: ["darwin", "linux", "windows"]
10+
goarch: ["amd64", "arm64"]
11+
ldflags:
12+
- '-s -w -X main.version={{.Version}} -X main.appname={{.ProjectName}}'
13+
dir: cmd/k6deps
14+
source:
15+
enabled: true
16+
name_template: "{{ .ProjectName }}_{{ .Version }}_source"
17+
18+
archives:
19+
- id: bundle
20+
format: tar.gz
21+
format_overrides:
22+
- goos: windows
23+
format: zip
24+
25+
checksum:
26+
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
27+
28+
snapshot:
29+
name_template: "{{ incpatch .Version }}-next+{{.ShortCommit}}{{if .IsGitDirty}}.dirty{{else}}{{end}}"
30+
31+
changelog:
32+
sort: asc
33+
abbrev: -1
34+
filters:
35+
exclude:
36+
- "^chore:"
37+
- "^docs:"
38+
- "^test:"

CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @grafana/k6-extensions

0 commit comments

Comments
 (0)