diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index aaa2dfedef..2dbde591e0 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -28,7 +28,41 @@ jobs: working-directory: ${{ github.workspace }} if: | contains(steps.changed-files.outputs.all_changed_files, '.go') - + golang-test: + name: go test + runs-on: ubuntu-latest + if: | + contains(needs.changed_files.outputs.changed_files, '.go') || + contains(needs.changed_files.outputs.changed_files, 'go.sum') || + ( + contains(needs.changed_files.outputs.changed_files, '.yml') || + contains(needs.changed_files.outputs.changed_files, '.yaml') + ) + && + ( + contains(needs.changed_files.outputs.changed_files, 'app') || + contains(needs.changed_files.outputs.changed_files, 'client') || + contains(needs.changed_files.outputs.changed_files, 'cmd') || + contains(needs.changed_files.outputs.changed_files, 'migrate') || + contains(needs.changed_files.outputs.changed_files, 'tests') || + contains(needs.changed_files.outputs.changed_files, 'x') + ) + env: + COVERAGE_DIR: out/coverage/unit/go + COVERAGE_PATH: out/coverage/unit/go/cover.out + FORMATTED_REPORT: out/coverage/unit/go/go-unit-cover.out + HTML_REPORT: out/coverage/unit/go/go-unit-cover.html + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup + uses: ./.github/actions/setup_go + - name: Go Test + run: | + mkdir -p ${{ env.COVERAGE_DIR }} + readarray -t test_dirs < <(find * -name "*_test.go" -exec dirname {} \; | sort | uniq | grep -v -e '^\.$') + half_nproc=$(( $(nproc --all) / 2 )) + printf '%s\0' "${test_dirs[@]}" | xargs -0 -P $half_nproc -n 1 -I {} go test "./{}" -race # - name: Load Version # id: load-version # run: | diff --git a/app/params/encoding.go b/app/params/encoding.go index 589897a6e1..2e030a2051 100644 --- a/app/params/encoding.go +++ b/app/params/encoding.go @@ -16,7 +16,7 @@ type EncodingConfig struct { Amino *codec.LegacyAmino } -// MakeEncodingConfigBlah creates a new EncodingConfig. +// MakeEncodingConfig creates a new EncodingConfig. func MakeEncodingConfig() EncodingConfig { amino := codec.NewLegacyAmino() interfaceRegistry := types.NewInterfaceRegistry() diff --git a/app/params/params.go b/app/params/params.go index 4d1056d518..675dbe4182 100644 --- a/app/params/params.go +++ b/app/params/params.go @@ -10,11 +10,10 @@ const ( // Default simulation operation weights for messages and gov proposals const ( - DefaultWeightMsgPlaceBid int = 20 - DefaultWeightMsgCreateAtomicSwap int = 20 - DefaultWeightMsgUpdatePrices int = 20 - DefaultWeightMsgCdp int = 20 - + DefaultWeightMsgPlaceBid int = 20 + DefaultWeightMsgCreateAtomicSwap int = 20 + DefaultWeightMsgUpdatePrices int = 20 + DefaultWeightMsgCdp int = 20 DefaultWeightMsgClaimReward int = 20 DefaultWeightMsgDeposit int = 20 DefaultWeightMsgWithdraw int = 20