diff --git a/.github/workflows/lint_and_test.yaml b/.github/workflows/lint_and_test.yaml index 4a578bf..8ac77b6 100644 --- a/.github/workflows/lint_and_test.yaml +++ b/.github/workflows/lint_and_test.yaml @@ -7,55 +7,26 @@ jobs: golangci: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - 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 + go-version-file: ./go.mod + cache-dependency-path: | + go.sum + - uses: jdx/mise-action@v2 + - name: add go bin to GITHUB PATH 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 + echo "$(go env GOROOT)/bin" >> $GITHUB_PATH + - 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/.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 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. 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 ```