-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from szkiba/feature/simplification
refactor: Simplification
- Loading branch information
Showing
27 changed files
with
287 additions
and
2,068 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Build | ||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
name: Bundle xk6 extensions | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build | ||
id: build | ||
uses: szkiba/xk6bundler@v0 | ||
with: | ||
with: github.com/szkiba/xk6-dotenv=/github/workspace | ||
k6_version: latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
release: | ||
name: Bundle xk6 extensions | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build | ||
id: build | ||
uses: szkiba/xk6bundler@v0 | ||
with: | ||
with: github.com/szkiba/xk6-dotenv=/github/workspace | ||
k6_version: latest | ||
|
||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: dist/*.tar.gz | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
context: ./${{ steps.build.outputs.dockerdir }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
/k6 | ||
.task | ||
node_modules | ||
/k6.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,135 @@ | ||
# MIT License | ||
# | ||
# Copyright (c) 2021 Iván Szkiba | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
# v1.55.2 | ||
# Please don't remove the first line. It uses in CI to determine the golangci version | ||
run: | ||
deadline: 5m | ||
|
||
issues: | ||
# Maximum issues count per one linter. Set to 0 to disable. Default is 50. | ||
max-issues-per-linter: 0 | ||
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3. | ||
max-same-issues: 0 | ||
|
||
# We want to try and improve the comments in the k6 codebase, so individual | ||
# non-golint items from the default exclusion list will gradually be added | ||
# to the exclude-rules below | ||
exclude-use-default: false | ||
|
||
exclude-rules: | ||
# Exclude duplicate code and function length and complexity checking in test | ||
# files (due to common repeats and long functions in test code) | ||
- path: _(test|gen)\.go | ||
linters: | ||
- cyclop | ||
- dupl | ||
- gocognit | ||
- funlen | ||
- lll | ||
- path: js\/modules\/k6\/http\/.*_test\.go | ||
linters: | ||
# k6/http module's tests are quite complex because they often have several nested levels. | ||
# The module is in maintainance mode, so we don't intend to port the tests to a parallel version. | ||
- paralleltest | ||
- tparallel | ||
- linters: | ||
- staticcheck # Tracked in https://github.com/grafana/xk6-grpc/issues/14 | ||
text: "The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated." | ||
- linters: | ||
- forbidigo | ||
text: 'use of `os\.(SyscallError|Signal|Interrupt)` forbidden' | ||
|
||
linters-settings: | ||
nolintlint: | ||
# Disable to ensure that nolint directives don't have a leading space. Default is true. | ||
allow-leading-space: false | ||
exhaustive: | ||
default-signifies-exhaustive: true | ||
govet: | ||
check-shadowing: true | ||
cyclop: | ||
max-complexity: 25 | ||
maligned: | ||
suggest-new: true | ||
dupl: | ||
threshold: 150 | ||
goconst: | ||
min-len: 10 | ||
min-occurrences: 4 | ||
funlen: | ||
lines: 80 | ||
statements: 60 | ||
forbidigo: | ||
forbid: | ||
- '^(fmt\\.Print(|f|ln)|print|println)$' | ||
# Forbid everything in os, except os.Signal and os.SyscalError | ||
- '^os\.(.*)$(# Using anything except Signal and SyscallError from the os package is forbidden )?' | ||
# Forbid everything in syscall except the uppercase constants | ||
- '^syscall\.[^A-Z_]+$(# Using anything except constants from the syscall package is forbidden )?' | ||
- '^logrus\.Logger$' | ||
|
||
linters: | ||
presets: | ||
- bugs | ||
- style | ||
- unused | ||
- complexity | ||
- format | ||
- performance | ||
disable-all: true | ||
enable: | ||
- asasalint | ||
- asciicheck | ||
- bidichk | ||
- bodyclose | ||
- contextcheck | ||
- cyclop | ||
- dogsled | ||
- dupl | ||
- durationcheck | ||
- errcheck | ||
- errchkjson | ||
- errname | ||
- errorlint | ||
- exhaustive | ||
- exportloopref | ||
disable: | ||
- nolintlint | ||
- exhaustivestruct | ||
- forbidigo | ||
- forcetypeassert | ||
- funlen | ||
- gocheckcompilerdirectives | ||
- gochecknoglobals | ||
- gochecknoinits | ||
- gocognit | ||
- goconst | ||
- gocritic | ||
- gofmt | ||
- gofumpt | ||
- goimports | ||
- gomoddirectives | ||
- goprintffuncname | ||
- gosec | ||
- gosimple | ||
- govet | ||
- importas | ||
- ineffassign | ||
- interfacebloat | ||
- lll | ||
- maligned | ||
- interfacer | ||
- scopelint | ||
- wrapcheck | ||
- makezero | ||
- misspell | ||
- nakedret | ||
- nestif | ||
- nilerr | ||
- nilnil | ||
- noctx | ||
- nolintlint | ||
- nosprintfhostport | ||
- paralleltest | ||
- prealloc | ||
- predeclared | ||
- promlinter | ||
- revive | ||
- reassign | ||
- rowserrcheck | ||
- sqlclosecheck | ||
- staticcheck | ||
- stylecheck | ||
- tenv | ||
- tparallel | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- usestdlibvars | ||
- wastedassign | ||
- whitespace | ||
fast: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.