Internalize logic to stage FinalizeBlock events (#2399) #8
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
name: Protocol Sims | |
# Sims workflow runs multiple types of simulations (nondeterminism, import-export, after-import, multi-seed-short) | |
# This workflow will run on all pushes to main, if a .go, .mod or .sum file have been changed | |
on: # yamllint disable-line rule:truthy | |
pull_request: | |
paths: | |
- 'protocol/**' | |
push: | |
branches: | |
- main | |
- 'release/protocol/v[0-9]+.[0-9]+.x' # e.g. release/protocol/v0.1.x | |
- 'release/protocol/v[0-9]+.x' # e.g. release/protocol/v1.x | |
paths: | |
- 'protocol/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./protocol | |
if: "!contains(github.event.head_commit.message, 'skip-sims')" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.22 | |
- name: Display go version | |
run: go version | |
- run: make build | |
install-runsim: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.22 | |
- name: Display go version | |
run: go version | |
- name: Install runsim | |
run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 | |
- uses: actions/cache@v2.1.3 | |
with: | |
path: ~/go/bin | |
key: ${{ runner.os }}-go-runsim-binary | |
test-sim-nondeterminism: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./protocol | |
needs: [build, install-runsim] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.22 | |
- name: Display go version | |
run: go version | |
- uses: actions/cache@v2.1.3 | |
with: | |
path: ~/go/bin | |
key: ${{ runner.os }}-go-runsim-binary | |
- name: test-sim-nondeterminism | |
run: | | |
make test-sim-nondeterminism | |
- name: Slack notify on failure | |
uses: slackapi/slack-github-action@v1.23.0 | |
id: slack | |
if: ${{ failure() }} | |
with: | |
# yamllint disable rule:line-length | |
payload: | | |
{ | |
"text": "*${{ github.workflow }}* job `${{ github.job }}` result :x: `${{ job.status }}` :x: for commit ${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n>Triggered by `${{ github.actor }}`, Commit hash ${{ github.sha }}", | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "*${{ github.workflow }}* job `${{ github.job }}` result :x: `${{ job.status }}` :x: for commit ${{ github.event.pull_request.html_url || github.event.head_commit.url }}" | |
} | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": ">Triggered by `${{ github.actor }}`, Commit hash ${{ github.sha }}" | |
} | |
} | |
] | |
} | |
# yamllint enable rule:line-length | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ENG_NOTIFY_WEBHOOK }} | |
test-sim-import-export: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./protocol | |
needs: [build, install-runsim] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.22 | |
- name: Display go version | |
run: go version | |
- uses: actions/cache@v2.1.3 | |
with: | |
path: ~/go/bin | |
key: ${{ runner.os }}-go-runsim-binary | |
- name: test-sim-import-export | |
run: | | |
make test-sim-import-export | |
- name: Slack notify on failure | |
uses: slackapi/slack-github-action@v1.23.0 | |
id: slack | |
if: ${{ failure() }} | |
with: | |
# yamllint disable rule:line-length | |
payload: | | |
{ | |
"text": "*${{ github.workflow }}* job `${{ github.job }}` result :x: `${{ job.status }}` :x: for commit ${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n>Triggered by `${{ github.actor }}`, Commit hash ${{ github.sha }}", | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "*${{ github.workflow }}* job `${{ github.job }}` result :x: `${{ job.status }}` :x: for commit ${{ github.event.pull_request.html_url || github.event.head_commit.url }}" | |
} | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": ">Triggered by `${{ github.actor }}`, Commit hash ${{ github.sha }}" | |
} | |
} | |
] | |
} | |
# yamllint enable rule:line-length | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ENG_NOTIFY_WEBHOOK }} | |
test-sim-after-import: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./protocol | |
needs: [build, install-runsim] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.22 | |
- name: Display go version | |
run: go version | |
- uses: actions/cache@v2.1.3 | |
with: | |
path: ~/go/bin | |
key: ${{ runner.os }}-go-runsim-binary | |
- name: test-sim-after-import | |
run: | | |
make test-sim-after-import | |
- name: Slack notify on failure | |
uses: slackapi/slack-github-action@v1.23.0 | |
id: slack | |
if: ${{ failure() }} | |
with: | |
# yamllint disable rule:line-length | |
payload: | | |
{ | |
"text": "*${{ github.workflow }}* job `${{ github.job }}` result :x: `${{ job.status }}` :x: for commit ${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n>Triggered by `${{ github.actor }}`, Commit hash ${{ github.sha }}", | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "*${{ github.workflow }}* job `${{ github.job }}` result :x: `${{ job.status }}` :x: for commit ${{ github.event.pull_request.html_url || github.event.head_commit.url }}" | |
} | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": ">Triggered by `${{ github.actor }}`, Commit hash ${{ github.sha }}" | |
} | |
} | |
] | |
} | |
# yamllint enable rule:line-length | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ENG_NOTIFY_WEBHOOK }} | |
test-sim-multi-seed-short: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./protocol | |
needs: [build, install-runsim] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.22 | |
- name: Display go version | |
run: go version | |
- uses: actions/cache@v2.1.3 | |
with: | |
path: ~/go/bin | |
key: ${{ runner.os }}-go-runsim-binary | |
- name: test-sim-multi-seed-short | |
run: | | |
make test-sim-multi-seed-short | |
- name: Slack notify on failure | |
uses: slackapi/slack-github-action@v1.23.0 | |
id: slack | |
if: ${{ failure() }} | |
with: | |
# yamllint disable rule:line-length | |
payload: | | |
{ | |
"text": "*${{ github.workflow }}* job `${{ github.job }}` result :x: `${{ job.status }}` :x: for commit ${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n>Triggered by `${{ github.actor }}`, Commit hash ${{ github.sha }}", | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "*${{ github.workflow }}* job `${{ github.job }}` result :x: `${{ job.status }}` :x: for commit ${{ github.event.pull_request.html_url || github.event.head_commit.url }}" | |
} | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": ">Triggered by `${{ github.actor }}`, Commit hash ${{ github.sha }}" | |
} | |
} | |
] | |
} | |
# yamllint enable rule:line-length | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ENG_NOTIFY_WEBHOOK }} |