From 08066afc074bec22ef02cd0a7fab0d69cb4d15c3 Mon Sep 17 00:00:00 2001 From: Kevin Yang <5478483+k-yang@users.noreply.github.com> Date: Thu, 28 Dec 2023 09:29:46 -0500 Subject: [PATCH] ci: add GHA workflow to run sim tests --- .github/workflows/sims.yml | 47 ------------------- .github/workflows/simulation-tests.yml | 63 ++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 47 deletions(-) delete mode 100644 .github/workflows/sims.yml create mode 100644 .github/workflows/simulation-tests.yml diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml deleted file mode 100644 index 38dfbbb3b..000000000 --- a/.github/workflows/sims.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Run short simulations - -on: - pull_request: - paths: ["**.go", "**.proto", "go.mod", "go.sum"] - -jobs: - install-runsim: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: 1.21 - cache: true - - uses: actions/cache@v3 - with: - path: ~/go/bin - key: ${{ runner.os }}-go-runsim-binary - - name: Install runsim - run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 - - test-sim-nondeterminism: - runs-on: ubuntu-latest - needs: [install-runsim] - steps: - - uses: actions/checkout@v4 - - uses: technote-space/get-diff-action@v6 - with: - SUFFIX_FILTER: | - **/**.go - go.mod - go.sum - - uses: actions/setup-go@v5 - with: - go-version: 1.21 - cache: true - if: env.GIT_DIFF - - uses: actions/cache@v3 - with: - path: ~/go/bin - key: ${{ runner.os }}-go-runsim-binary - if: env.GIT_DIFF - - name: test-sim-nondeterminism - run: | - make test-sim-nondeterminism - if: env.GIT_DIFF diff --git a/.github/workflows/simulation-tests.yml b/.github/workflows/simulation-tests.yml new file mode 100644 index 000000000..c446cddb1 --- /dev/null +++ b/.github/workflows/simulation-tests.yml @@ -0,0 +1,63 @@ +name: Run simulations + +on: + push: + branches: + # every push to default branch + - main + schedule: + # once per day + - cron: "0 0 * * *" + pull_request: + branches: + # every pull request to default branch + - main + +jobs: + test-sim-nondeterminism: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: 1.21 + cache: true + - name: TestAppStateDeterminism + run: | + make test-sim-nondeterminism + + test-sim-default-genesis-fast: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: 1.21 + cache: true + - name: TestFullAppSimulation + run: | + make test-sim-default-genesis-fast + + test-sim-import-export: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: 1.21 + cache: true + - name: TestAppImportExport + run: | + make test-sim-import-export + + test-sim-after-import: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: 1.21 + cache: true + - name: TestAppSimulationAfterImport + run: | + make test-sim-after-import \ No newline at end of file