From 0b61f000b6ca6fb44e00679e77d951d6fab22bc6 Mon Sep 17 00:00:00 2001 From: t-umeda Date: Thu, 17 Oct 2024 12:33:51 +0900 Subject: [PATCH 1/5] feat: migrate mise --- .github/workflows/lint_and_test.yaml | 49 ++++------------------------ Makefile | 6 ++-- 2 files changed, 8 insertions(+), 47 deletions(-) diff --git a/.github/workflows/lint_and_test.yaml b/.github/workflows/lint_and_test.yaml index 4a578bf..7620391 100644 --- a/.github/workflows/lint_and_test.yaml +++ b/.github/workflows/lint_and_test.yaml @@ -7,55 +7,18 @@ jobs: golangci: runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v5 - with: - go-version: ^1.21 - uses: actions/checkout@v4 - - name: setup asdf - uses: asdf-vm/actions/setup@6278efebb38ae025cc91dd008910f549e775a8c8 - - name: set env ASDF_PYTHON_DEFAULT_PACKAGES_FILE - run: | - export ASDF_PYTHON_DEFAULT_PACKAGES_FILE=$(pwd) - echo "legacy_version_file = yes" > ~/.asdfrc - - name: asdf cache - id: asdf_cache_id - uses: actions/cache@v4 - with: - path: ~/.asdf - key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }} - restore-keys: | - ${{ runner.os }}-asdf- - - name: asdf install - if: steps.asdf_cache_id.outputs.cache-hit != 'true' - uses: asdf-vm/actions/install@6278efebb38ae025cc91dd008910f549e775a8c8 + - uses: jdx/mise-action@v2 + - name: go mod tidy + run: go mod tidy + - name: make install go tools + run: make install-go-tools - name: pre-commit install run: pre-commit install - - name: asdf go cache - id: asdf_go_cache_id - uses: actions/cache@v4 - with: - path: ~/.asdf/installs/golang - key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-asdf-go- - - name: go mod tidy and install - if: steps.asdf_go_cache_id.outputs.cache-hit != 'true' - run: | - go mod tidy - make install-go-tools - - name: go mod cache - uses: actions/cache@v4 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: - version: latest + version: v1.61.0 - name: build run: make build - name: testing diff --git a/Makefile b/Makefile index 3bdaa3d..52c2e47 100644 --- a/Makefile +++ b/Makefile @@ -65,15 +65,13 @@ docker-release: ## Release the container with tag latest and version ## Golang: install-go-tools: ## install project go tools cat tools.go | awk -F'"' '/_/ {print $$2s}' | xargs -tI {} go install {} - asdf reshim golang go-gen: ## go:generate invocations go generate ./... -## ASDF: +## mise: install-dev-pkg: ## install .tool-version - awk '{print $$1}' .tool-versions | xargs -I{} asdf plugin add {} || true - asdf install + mise install ## Help: help: ## Show this help. From c956203f2d30b44b6f0774592cd15b5c98a85a62 Mon Sep 17 00:00:00 2001 From: t-umeda Date: Thu, 24 Oct 2024 12:07:02 +0900 Subject: [PATCH 2/5] perf: use actions setup-go --- .github/workflows/lint_and_test.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/lint_and_test.yaml b/.github/workflows/lint_and_test.yaml index 7620391..e8efa31 100644 --- a/.github/workflows/lint_and_test.yaml +++ b/.github/workflows/lint_and_test.yaml @@ -8,6 +8,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: ./go.mod + cache-dependency-path: | + go.sum - uses: jdx/mise-action@v2 - name: go mod tidy run: go mod tidy From 3e516e6a63a6aaa4a111a74ecfc9e8b95f145f73 Mon Sep 17 00:00:00 2001 From: t-umeda Date: Tue, 12 Nov 2024 10:04:15 +0900 Subject: [PATCH 3/5] fix: add go bin path to github path --- .github/workflows/lint_and_test.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint_and_test.yaml b/.github/workflows/lint_and_test.yaml index e8efa31..8ac77b6 100644 --- a/.github/workflows/lint_and_test.yaml +++ b/.github/workflows/lint_and_test.yaml @@ -12,8 +12,11 @@ jobs: with: go-version-file: ./go.mod cache-dependency-path: | - go.sum + go.sum - uses: jdx/mise-action@v2 + - name: add go bin to GITHUB PATH + run: | + echo "$(go env GOROOT)/bin" >> $GITHUB_PATH - name: go mod tidy run: go mod tidy - name: make install go tools From f1d241d6fd4e88ee5b953364f3b7527ccd32df8f Mon Sep 17 00:00:00 2001 From: t-umeda Date: Tue, 12 Nov 2024 12:50:06 +0900 Subject: [PATCH 4/5] feat: Migrate from .tool-versions to .mise.toml --- .mise.toml | 6 ++++++ .tool-versions | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 .mise.toml delete mode 100644 .tool-versions diff --git a/.mise.toml b/.mise.toml new file mode 100644 index 0000000..c6c958c --- /dev/null +++ b/.mise.toml @@ -0,0 +1,6 @@ +[tools] +go = "1.23.2" +python = "3.13.0" +pre-commit = "3.8.0" +direnv = "2.35.0" +jq = "1.6" diff --git a/.tool-versions b/.tool-versions deleted file mode 100644 index 7c4088e..0000000 --- a/.tool-versions +++ /dev/null @@ -1,5 +0,0 @@ -golang 1.23.2 -python 3.13.0 -pre-commit 3.8.0 -direnv 2.35.0 -jq 1.6 From 445281df2dd8dc7910f7393de58014e64afcf85b Mon Sep 17 00:00:00 2001 From: t-umeda Date: Tue, 12 Nov 2024 13:11:41 +0900 Subject: [PATCH 5/5] feat: update README.md (change asdf to mise) --- README.md | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 130ab6a..ba193d3 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,40 @@ # xk6-gtp -Client extension for interacting with a use GTP proto of your k6 test. -🚧 This project WIP... 🚧 +Client extension for interacting with a GTP protocol in your k6 test. -## Prepair -require asdf installed. -[how to asdf install](https://asdf-vm.com/guide/getting-started.html#_2-download-asdf) +🚧 This project is a WIP... 🚧 + +## Preparation + +Requires packages and tools. + +- [mise](https://github.com/jdx/mise) Install tools required for development. + ```shell= make install-dev-pkg ``` ## Build + ```shell= make install-go-tools make build ``` -## Test Running +## Running Tests + ```shell ./out/bin/xk6 run example/echo-stress.js ./out/bin/pgw ``` -## Support scenario +## Supported Scenarios + ### GTPv2-C + - [x] Node monitoring (Echo Request/Echo Response) - [x] Create Session (Create Session Request/Create Session Response) - [x] sgw->pgw scenario @@ -36,21 +44,21 @@ make build - [x] sgw->pgw scenario - [ ] Delete Bearer (Delete Bearer Request/Delete Bearer Response) +## Special Thanks -## Special thanks -This PoC takes full advantage of [go-gtp](https://github.com/wmnsk/go-gtp). Thanks to the @wmnsk and developer all. +This PoC takes full advantage of [go-gtp](https://github.com/wmnsk/go-gtp). Thanks to @wmnsk and all developers. ## Developers Settings ```shell -# fmt, lint, commitmessage validate...etc checker +# Format, lint, commit message validation, etc. pre-commit install -# mob programing +# Mob programming co-author hook > .git/hooks/prepare-commit-msg chmod +x .git/hooks/prepare-commit-msg -# create docker image +# Create Docker image make docker-build make docker-release ```