-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add x/group simulations (#251)
* test * Add simulation workflow * setup simulations * fix lint * lint * update workflow * lint * delete proto files * make proto-gen * add more sim tests * fix test * add operations * WIP * add weighted operations * fix errors * Update x/group/module/module.go * WIP * delete unused files * WIP * WIP * fix lint issues * fix lint issues * fix create group account simulation * add more weighted operations * add more weighted operations * refactor * add weighted operations * fix tests * cleanup * build flags * fix build * add build flags to simulations * update sims.mk * code format * add pagination to groups * review changes * review changes * review changes * review changes * add query groups tests * review changes * remove unused files * review changes * fix lint issue * remove query all groups * review changes * go.mod * fix error * run make proto-gen * fix errors * fix lint error * WIP group genesis simulation * register group simulations * add group accounts & proposals * add random votes * update doc * run make proto-gen * feat: add genesis simulation log * review changes * fix: lint error * Update x/group/simulation/genesis.go Co-authored-by: Anil Kumar Kammari <[email protected]> * Update x/group/simulation/genesis.go Co-authored-by: Anil Kumar Kammari <[email protected]> * Update x/group/simulation/genesis.go Co-authored-by: Anil Kumar Kammari <[email protected]> * review changes * try setup separate simulation jobs * add build flags to simulations * randomize votes * update simulations jobs * update simulation jobs * test github action custom env variable * add experimental flag to simulation actions * add description to weights * review changes * Update x/group/module/module.go Co-authored-by: Anil Kumar Kammari <[email protected]> * review changes * try fixing simulations * fix simulations Co-authored-by: Anil Kumar Kammari <[email protected]>
- Loading branch information
Showing
20 changed files
with
2,416 additions
and
867 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,284 @@ | ||
name: Sims | ||
# Sims workflow runs multiple types of simulations (nondeterminism, import-export, after-import, multi-seed-short) | ||
# This workflow will run on all Pull Requests, if a .go, .mod or .sum file have been changed | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
cleanup-runs: | ||
runs-on: ubuntu-latest | ||
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'" | ||
steps: | ||
- uses: rokroskar/workflow-run-cleanup-action@master | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, 'skip-sims')" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.15 | ||
- name: Display go version | ||
run: go version | ||
- run: make build | ||
|
||
install-runsim: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.15 | ||
- name: Display go version | ||
run: go version | ||
- name: Install runsim | ||
run: export GO111MODULE="on" && go get github.com/cosmos/tools/cmd/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
path: ~/go/bin | ||
key: ${{ runner.os }}-go-runsim-binary | ||
|
||
# experimental simulations | ||
sim-nondeterminism-experimental: | ||
runs-on: ubuntu-latest | ||
needs: [build, install-runsim] | ||
env: | ||
EXPERIMENTAL: true | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.15 | ||
- name: Display go version | ||
run: go version | ||
- uses: technote-space/get-diff-action@v4 | ||
with: | ||
PATTERNS: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
- uses: actions/[email protected] | ||
with: | ||
path: ~/go/bin | ||
key: ${{ runner.os }}-go-runsim-binary | ||
if: env.GIT_DIFF | ||
- name: sim-nondeterminism-experimental | ||
run: | | ||
make sim-regen-nondeterminism | ||
if: env.GIT_DIFF | ||
|
||
sim-import-export-experimental: | ||
runs-on: ubuntu-latest | ||
needs: [build, install-runsim] | ||
env: | ||
EXPERIMENTAL: true | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.15 | ||
- name: Display go version | ||
run: go version | ||
- uses: technote-space/get-diff-action@v4 | ||
with: | ||
SUFFIX_FILTER: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
SET_ENV_NAME_INSERTIONS: 1 | ||
SET_ENV_NAME_LINES: 1 | ||
- uses: actions/[email protected] | ||
with: | ||
path: ~/go/bin | ||
key: ${{ runner.os }}-go-runsim-binary | ||
if: env.GIT_DIFF | ||
- name: sim-import-export-experimental | ||
run: | | ||
make sim-regen-import-export | ||
if: env.GIT_DIFF | ||
|
||
sim-after-import-experimental: | ||
runs-on: ubuntu-latest | ||
needs: [build, install-runsim] | ||
env: | ||
EXPERIMENTAL: true | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.15 | ||
- name: Display go version | ||
run: go version | ||
- uses: technote-space/get-diff-action@v4 | ||
with: | ||
SUFFIX_FILTER: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
SET_ENV_NAME_INSERTIONS: 1 | ||
SET_ENV_NAME_LINES: 1 | ||
- uses: actions/[email protected] | ||
with: | ||
path: ~/go/bin | ||
key: ${{ runner.os }}-go-runsim-binary | ||
if: env.GIT_DIFF | ||
- name: sim-after-import-experimental | ||
run: | | ||
make sim-regen-after-import | ||
if: env.GIT_DIFF | ||
|
||
sim-fullapp-experimental: | ||
runs-on: ubuntu-latest | ||
needs: [build, install-runsim] | ||
env: | ||
EXPERIMENTAL: true | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.15 | ||
- name: Display go version | ||
run: go version | ||
- uses: technote-space/get-diff-action@v4 | ||
with: | ||
SUFFIX_FILTER: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
SET_ENV_NAME_INSERTIONS: 1 | ||
SET_ENV_NAME_LINES: 1 | ||
- uses: actions/[email protected] | ||
with: | ||
path: ~/go/bin | ||
key: ${{ runner.os }}-go-runsim-binary | ||
if: env.GIT_DIFF | ||
- name: sim-fullapp-experimental | ||
run: | | ||
make sim-regen-fast | ||
if: env.GIT_DIFF | ||
|
||
|
||
# stable simulation jobs | ||
sim-nondeterminism-stable: | ||
runs-on: ubuntu-latest | ||
needs: [build, install-runsim] | ||
env: | ||
EXPERIMENTAL: false | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.15 | ||
- name: Display go version | ||
run: go version | ||
- uses: technote-space/get-diff-action@v4 | ||
with: | ||
PATTERNS: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
- uses: actions/[email protected] | ||
with: | ||
path: ~/go/bin | ||
key: ${{ runner.os }}-go-runsim-binary | ||
if: env.GIT_DIFF | ||
- name: sim-nondeterminism-stable | ||
run: | | ||
make sim-regen-nondeterminism | ||
if: env.GIT_DIFF | ||
|
||
sim-import-export-stable: | ||
runs-on: ubuntu-latest | ||
needs: [build, install-runsim] | ||
env: | ||
EXPERIMENTAL: false | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.15 | ||
- name: Display go version | ||
run: go version | ||
- uses: technote-space/get-diff-action@v4 | ||
with: | ||
SUFFIX_FILTER: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
SET_ENV_NAME_INSERTIONS: 1 | ||
SET_ENV_NAME_LINES: 1 | ||
- uses: actions/[email protected] | ||
with: | ||
path: ~/go/bin | ||
key: ${{ runner.os }}-go-runsim-binary | ||
if: env.GIT_DIFF | ||
- name: sim-import-export-stable | ||
run: | | ||
make sim-regen-import-export | ||
if: env.GIT_DIFF | ||
|
||
sim-after-import-stable: | ||
runs-on: ubuntu-latest | ||
needs: [build, install-runsim] | ||
env: | ||
EXPERIMENTAL: false | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.15 | ||
- name: Display go version | ||
run: go version | ||
- uses: technote-space/get-diff-action@v4 | ||
with: | ||
SUFFIX_FILTER: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
SET_ENV_NAME_INSERTIONS: 1 | ||
SET_ENV_NAME_LINES: 1 | ||
- uses: actions/[email protected] | ||
with: | ||
path: ~/go/bin | ||
key: ${{ runner.os }}-go-runsim-binary | ||
if: env.GIT_DIFF | ||
- name: sim-after-import-stable | ||
run: | | ||
make sim-regen-after-import | ||
if: env.GIT_DIFF | ||
|
||
sim-fullapp-stable: | ||
runs-on: ubuntu-latest | ||
needs: [build, install-runsim] | ||
env: | ||
EXPERIMENTAL: false | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.15 | ||
- name: Display go version | ||
run: go version | ||
- uses: technote-space/get-diff-action@v4 | ||
with: | ||
SUFFIX_FILTER: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
SET_ENV_NAME_INSERTIONS: 1 | ||
SET_ENV_NAME_LINES: 1 | ||
- uses: actions/[email protected] | ||
with: | ||
path: ~/go/bin | ||
key: ${{ runner.os }}-go-runsim-binary | ||
if: env.GIT_DIFF | ||
- name: sim-fullapp-stable | ||
run: | | ||
make sim-regen-fast | ||
if: env.GIT_DIFF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.