Skip to content

Commit

Permalink
Merge pull request #63 from bbsakura/feat/migrate-mise
Browse files Browse the repository at this point in the history
Migrate from asdf to mise
  • Loading branch information
x86taka authored Nov 12, 2024
2 parents 6ab6d89 + 445281d commit df14a89
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 62 deletions.
53 changes: 12 additions & 41 deletions .github/workflows/lint_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -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"
5 changes: 0 additions & 5 deletions .tool-versions

This file was deleted.

6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
```

0 comments on commit df14a89

Please sign in to comment.