github.com/Finschia/finschia-sdk@v0.48.1/.github/workflows/sims.yml (about) 1 name: Sims 2 # Sims workflow runs multiple types of simulations (nondeterminism, import-export, after-import, multi-seed-short) 3 # This workflow will run on all Pull Requests, if a .go, .mod or .sum file have been changed 4 on: 5 pull_request: 6 branches-ignore: 7 - "release/*" 8 push: 9 branches: 10 - main 11 - rc*/* 12 13 jobs: 14 cleanup-runs: 15 runs-on: ubuntu-latest 16 if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'" 17 steps: 18 - uses: rokroskar/workflow-run-cleanup-action@master 19 env: 20 GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" 21 22 build: 23 runs-on: ubuntu-latest 24 if: "!contains(github.event.head_commit.message, 'skip-sims')" 25 steps: 26 - uses: actions/checkout@v3 27 - uses: actions/setup-go@v4.0.1 28 with: 29 go-version: '1.20' 30 - name: Display go version 31 run: go version 32 - run: make build 33 34 install-runsim: 35 runs-on: ubuntu-latest 36 needs: build 37 steps: 38 - uses: actions/setup-go@v4.0.1 39 with: 40 go-version: '1.20' 41 - name: Display go version 42 run: go version 43 - name: Install runsim 44 run: export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/runsim@v1.0.0 45 - uses: actions/cache@v3.3.1 46 with: 47 path: ~/go/bin 48 key: ${{ runner.os }}-go-runsim-binary 49 50 test-sim-nondeterminism-short: 51 runs-on: ubuntu-latest 52 needs: [build, install-runsim] 53 steps: 54 - uses: actions/checkout@v3 55 - uses: actions/setup-go@v4.0.1 56 with: 57 go-version: '1.20' 58 - name: Display go version 59 run: go version 60 - uses: technote-space/get-diff-action@v6.1.2 61 with: 62 PATTERNS: | 63 **/**.go 64 !**/**_test.go 65 go.mod 66 go.sum 67 - uses: actions/cache@v3.3.1 68 with: 69 path: ~/go/bin 70 key: ${{ runner.os }}-go-runsim-binary 71 if: env.GIT_DIFF 72 - name: test-sim-nondeterminism-short 73 run: | 74 make test-sim-nondeterminism-short 75 if: env.GIT_DIFF 76 77 test-sim-import-export-short: 78 runs-on: ubuntu-latest 79 needs: [build, install-runsim] 80 steps: 81 - uses: actions/checkout@v3 82 - uses: actions/setup-go@v4.0.1 83 with: 84 go-version: '1.20' 85 - name: Display go version 86 run: go version 87 - uses: technote-space/get-diff-action@v6.1.2 88 with: 89 PATTERNS: | 90 **/**.go 91 !**/**_test.go 92 go.mod 93 go.sum 94 SET_ENV_NAME_INSERTIONS: 1 95 SET_ENV_NAME_LINES: 1 96 - uses: actions/cache@v3.3.1 97 with: 98 path: ~/go/bin 99 key: ${{ runner.os }}-go-runsim-binary 100 if: env.GIT_DIFF 101 - name: test-sim-import-export-short 102 run: | 103 make test-sim-import-export-short 104 if: env.GIT_DIFF 105 106 test-sim-after-import-short: 107 runs-on: ubuntu-latest 108 needs: [build, install-runsim] 109 steps: 110 - uses: actions/checkout@v3 111 - uses: actions/setup-go@v4.0.1 112 with: 113 go-version: '1.20' 114 - name: Display go version 115 run: go version 116 - uses: technote-space/get-diff-action@v6.1.2 117 with: 118 PATTERNS: | 119 **/**.go 120 !**/**_test.go 121 go.mod 122 go.sum 123 SET_ENV_NAME_INSERTIONS: 1 124 SET_ENV_NAME_LINES: 1 125 - uses: actions/cache@v3.3.1 126 with: 127 path: ~/go/bin 128 key: ${{ runner.os }}-go-runsim-binary 129 if: env.GIT_DIFF 130 - name: test-sim-after-import-short 131 run: | 132 make test-sim-after-import-short 133 if: env.GIT_DIFF 134 135 test-sim-multi-seed-short: 136 runs-on: ubuntu-latest 137 needs: [build, install-runsim] 138 steps: 139 - uses: actions/checkout@v3 140 - uses: actions/setup-go@v4.0.1 141 with: 142 go-version: '1.20' 143 - name: Display go version 144 run: go version 145 - uses: technote-space/get-diff-action@v6.1.2 146 with: 147 PATTERNS: | 148 **/**.go 149 !**/**_test.go 150 go.mod 151 go.sum 152 SET_ENV_NAME_INSERTIONS: 1 153 SET_ENV_NAME_LINES: 1 154 - uses: actions/cache@v3.3.1 155 with: 156 path: ~/go/bin 157 key: ${{ runner.os }}-go-runsim-binary 158 if: env.GIT_DIFF 159 - name: test-sim-multi-seed-short 160 run: | 161 make test-sim-multi-seed-short 162 if: env.GIT_DIFF