Skip to content

Commit

Permalink
Merge branch 'main' into julien/params-decouple-simapp
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Jun 15, 2022
2 parents ad0a1db + 4385325 commit 295b617
Show file tree
Hide file tree
Showing 23 changed files with 2,073 additions and 190 deletions.
36 changes: 36 additions & 0 deletions .github/actions/last-workflow-status/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# from https://github.com/MercymeIlya/last-workflow-status with fixes
name: "Get status of last workflow"
description: "Get conclusion of last workflow run on current branch."
branding:
icon: "arrow-left"
color: "yellow"
inputs:
github_token:
description: Secret GitHub API token to use for making API requests.
default: ${{ github.token }}
required: true
outputs:
last_status:
description: "Conclusion of last workflow run on current branch"
value: ${{ steps.last_status.outputs.last_status }}
runs:
using: "composite"
steps:
- name: Get workflow id
shell: bash
run: |
WORKFLOW_ID=$(curl --header 'authorization: Bearer ${{ inputs.github_token }}' \
--header 'content-type: application/json' \
https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }} | jq -r .workflow_id)
echo "WORKFLOW_ID=$WORKFLOW_ID" >> $GITHUB_ENV
echo "Workflow id: ${WORKFLOW_ID}"
- name: Get previous build status
shell: bash
id: last_status
run: |
last_status=$(curl --silent --header 'authorization: Bearer ${{ inputs.github_token }}' \
--header 'content-type: application/json' \
"https://api.github.com/repos/${{ github.repository }}/actions/workflows/${{ env.WORKFLOW_ID }}/runs?per_page=1&status=completed&branch=${{ env.GITHUB_HEAD_REF }}" \
| jq -r .workflow_runs[0].conclusion)
echo "Status of the previous build: $last_status"
echo "::set-output name=last_status::${last_status}"
2 changes: 1 addition & 1 deletion .github/workflows/dependencies-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
- name: "Checkout Repository"
uses: actions/checkout@v3
- name: "Dependency Review"
uses: actions/dependency-review-action@v1
uses: actions/dependency-review-action@v2
31 changes: 29 additions & 2 deletions .github/workflows/sims-045.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,38 @@ jobs:
run: |
make test-sim-multi-seed-short
sims-fail:
sims-notify-success:
needs:
[test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export]
runs-on: ubuntu-latest
if: ${{ success() }}
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Get previous workflow status
uses: ./.github/actions/last-workflow-status
id: last_status
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Notify Slack on success
if: ${{ steps.last_status.outputs.last_status == 'failure' }}
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: cosmos-sdk-sims
SLACK_USERNAME: Sim Tests release/0.45.x
SLACK_ICON_EMOJI: ":white_check_mark:"
SLACK_COLOR: good
SLACK_MESSAGE: 0.45.x Sims are passing
SLACK_FOOTER: ""

sims-notify-failure:
needs:
[test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export]
if: ${{ failure() }}
runs-on: ubuntu-latest
if: ${{ failure() }}
steps:
- name: Notify Slack on failure
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7
Expand Down
31 changes: 29 additions & 2 deletions .github/workflows/sims-046.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,38 @@ jobs:
run: |
make test-sim-multi-seed-short
sims-fail:
sims-notify-success:
needs:
[test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export]
runs-on: ubuntu-latest
if: ${{ success() }}
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Get previous workflow status
uses: ./.github/actions/last-workflow-status
id: last_status
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Notify Slack on success
if: ${{ steps.last_status.outputs.last_status == 'failure' }}
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: cosmos-sdk-sims
SLACK_USERNAME: Sim Tests release/0.46.x
SLACK_ICON_EMOJI: ":white_check_mark:"
SLACK_COLOR: good
SLACK_MESSAGE: 0.46.x Sims are passing
SLACK_FOOTER: ""

sims-notify-failure:
needs:
[test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export]
if: ${{ failure() }}
runs-on: ubuntu-latest
if: ${{ failure() }}
steps:
- name: Notify Slack on failure
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7
Expand Down
32 changes: 21 additions & 11 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,36 +102,46 @@ jobs:
run: |
make test-sim-multi-seed-short
sims-fail:
sims-notify-success:
needs:
[test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export]
if: ${{ failure() }}
runs-on: ubuntu-latest
if: ${{ success() }}
steps:
- name: Notify Slack on failure
- name: Check out repository
uses: actions/checkout@v3

- name: Get previous workflow status
uses: ./.github/actions/last-workflow-status
id: last_status
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Notify Slack on success
if: ${{ steps.last_status.outputs.last_status == 'failure' }}
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: cosmos-sdk-sims
SLACK_USERNAME: Sim Tests
SLACK_ICON_EMOJI: ":skull:"
SLACK_COLOR: danger
SLACK_MESSAGE: Sims are failing
SLACK_ICON_EMOJI: ":white_check_mark:"
SLACK_COLOR: good
SLACK_MESSAGE: Sims are passing
SLACK_FOOTER: ""

sims-success:
sims-notify-failure:
needs:
[test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export]
if: ${{ success() }}
runs-on: ubuntu-latest
if: ${{ failure() }}
steps:
- name: Notify Slack on failure
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: cosmos-sdk-sims
SLACK_USERNAME: Sim Tests
SLACK_ICON_EMOJI: ":white_check_mark:"
SLACK_COLOR: good
SLACK_MESSAGE: Sims are passing
SLACK_ICON_EMOJI: ":skull:"
SLACK_COLOR: danger
SLACK_MESSAGE: Sims are failing
SLACK_FOOTER: ""
Loading

0 comments on commit 295b617

Please sign in to comment.