From 1a6f9d4cbe75af0a4938be0698b662cea9ccd52a Mon Sep 17 00:00:00 2001 From: Hanjun Kim Date: Fri, 14 Feb 2025 21:50:00 +0800 Subject: [PATCH] ci: add sims action (#248) ## Description Closes: MILK-192 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/milkyway-labs/milkyway/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html) - [ ] included the necessary unit and integration [tests](https://github.com/milkyway-labs/milkyway/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- .github/workflows/sims.yml | 108 +++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 .github/workflows/sims.yml diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml new file mode 100644 index 000000000..f5497bd73 --- /dev/null +++ b/.github/workflows/sims.yml @@ -0,0 +1,108 @@ +name: Sims +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !contains(github.ref, 'tags/')}} + +jobs: + test-sim-nondeterminism: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout ๐Ÿ›Ž๏ธ + uses: actions/checkout@v4 + + - name: Setup Go ๐Ÿงฐ + uses: actions/setup-go@v5 + with: + go-version: '1.23' + + - name: Compute diff ๐Ÿ“œ + uses: technote-space/get-diff-action@v6.1.2 + with: + PATTERNS: | + **/**.go + go.mod + go.sum + + - name: Save cache ๐Ÿ’พ + uses: actions/cache@v4 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + if: env.GIT_DIFF + + - name: Run nondeterminism simulation ๐Ÿงช + run: | + make test-sim-nondeterminism + if: env.GIT_DIFF + + test-sim-multi-seed-short: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout ๐Ÿ›Ž๏ธ + uses: actions/checkout@v4 + + - name: Setup Go ๐Ÿงฐ + uses: actions/setup-go@v5 + with: + go-version: '1.23' + + - name: Compute diff ๐Ÿ“œ + uses: technote-space/get-diff-action@v6.1.2 + with: + PATTERNS: | + **/**.go + go.mod + go.sum + + - name: Save cache ๐Ÿ’พ + uses: actions/cache@v4 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + if: env.GIT_DIFF + + - name: Run multi-seed-short simulation ๐Ÿงช + run: | + make test-sim-multi-seed-short + if: env.GIT_DIFF + + test-sim-import-export: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout ๐Ÿ›Ž๏ธ + uses: actions/checkout@v4 + + - name: Setup Go ๐Ÿงฐ + uses: actions/setup-go@v5 + with: + go-version: '1.23' + + - name: Compute diff ๐Ÿ“œ + uses: technote-space/get-diff-action@v6.1.2 + with: + PATTERNS: | + **/**.go + go.mod + go.sum + + - name: Save cache ๐Ÿ’พ + uses: actions/cache@v4 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + if: env.GIT_DIFF + + - name: Run import-export simulation ๐Ÿงช + run: | + make test-sim-import-export + if: env.GIT_DIFF