Skip to content

Commit

Permalink
Merge pull request #9 from szkiba/feature/build
Browse files Browse the repository at this point in the history
build system and k6 upgrade to v0.43.0
  • Loading branch information
szkiba authored May 22, 2023
2 parents 3734cbd + 7f430b5 commit 34bdc6f
Show file tree
Hide file tree
Showing 19 changed files with 701 additions and 315 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SPDX-FileCopyrightText: 2023 Iván Szkiba
#
# SPDX-License-Identifier: MIT

name: Build
on:
pull_request:
workflow_dispatch:
push:
branches:
- feature/*

jobs:
build:
name: Bundle xk6 extensions
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Build
id: build
uses: szkiba/xk6bundler@v0
with:
with: github.com/szkiba/xk6-prometheus=/github/workspace
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# SPDX-FileCopyrightText: 2023 Iván Szkiba
#
# SPDX-License-Identifier: MIT

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: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Build
id: build
uses: szkiba/xk6bundler@v0
with:
with: github.com/szkiba/xk6-prometheus=/github/workspace

- 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@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
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@v4
with:
push: true
context: ./${{ steps.build.outputs.dockerdir }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Binary file added .github/xk6-prometheus-social.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 94 additions & 0 deletions .github/xk6-prometheus-social.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# SPDX-FileCopyrightText: 2023 Iván Szkiba
#
# SPDX-License-Identifier: MIT

k6
.task

coverage.txt

logs
*.log

bin

.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
37 changes: 37 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-FileCopyrightText: 2021 - 2023 Iván Szkiba
#
# SPDX-License-Identifier: MIT

linters:
presets:
- bugs
- style
- unused
- complexity
- format
- performance
enable:
- exportloopref
disable:
- testpackage
- nolintlint
- gochecknoglobals
- gochecknoinits
- lll
- maligned
- interfacer
- scopelint
- wrapcheck
# deprecated
- deadcode
- nosnakecase
- exhaustivestruct
- ifshort
- structcheck
- varcheck
- golint
# generics
- rowserrcheck
- sqlclosecheck
- wastedassign

9 changes: 9 additions & 0 deletions LICENSES/MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) <year> <copyright holders>

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.
Loading

0 comments on commit 34bdc6f

Please sign in to comment.