Skip to content

Commit 756bd0f

Browse files
committed
fix: notifications
1 parent 94bdacc commit 756bd0f

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

.github/workflows/build-applications.yaml

+16-7
Original file line numberDiff line numberDiff line change
@@ -460,14 +460,23 @@ jobs:
460460
"https://api.github.com/repos/${REPO}/actions/runs/${PREVIOUS_RUN_ID}/jobs" \
461461
| jq -r --arg JOB_NAME "$JOB_NAME" '.jobs[] | select(.name == $JOB_NAME) | .conclusion')
462462
463-
echo "previous_status=${PREVIOUS_STATUS}" >> $GITHUB_OUTPUT
463+
echo "previous_status=${PREVIOUS_STATUS}"
464+
465+
if [[ -z "$PREVIOUS_STATUS" ]]; then
466+
echo "notify_step=false" >> $GITHUB_ENV
467+
exit 0
468+
fi
469+
470+
if [[ "$PREVIOUS_STATUS" == "failure" && "$APP_STATUS" == "success" ]]; then
471+
echo "notify_step=true" >> $GITHUB_ENV
472+
elif [[ "$PREVIOUS_STATUS" == "success" && "$APP_STATUS" == "failure" ]]; then
473+
echo "notify_step=true" >> $GITHUB_ENV
474+
else
475+
echo "notify_step=false" >> $GITHUB_ENV
476+
fi
477+
464478
- name: Notify Slack
465-
if: |
466-
inputs.sendNotifications == true &&
467-
(
468-
(env.app_status == 'true' && steps.previous-run.outputs.previous_status == 'failure') ||
469-
(env.app_status != 'true' && steps.previous-run.outputs.previous_status == 'success')
470-
)
479+
if: ${{ inputs.sendNotifications == 'true' && env.notify_step == 'true' }}
471480
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # v2.3.2
472481
env:
473482
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

apps/cosmos-sdk-v2/ci/test.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,18 @@ set -x
55

66
BINARY_PATH=$(find $(go env GOPATH)/bin | grep $BINARY_NAME | tail -n 1)
77

8+
# Rename the binary as makefile is not consistent
9+
mv "${BINARY_PATH}" "${BINARY_PATH}v2"
10+
811
# Set the timeout to 60 seconds
912
TIMEOUT=60
1013
START_TIME=$(date +%s)
1114

1215
cd ${MATRIX_APP_REPOSITORY}
1316
make init-simapp-v2
17+
18+
# Rename the binary as makefile is not consistent
19+
mv "${BINARY_PATH}v2" "${BINARY_PATH}"
1420
${BINARY_PATH} start > ./output.log 2>1 &
1521
APP_PID=$!
1622

@@ -27,7 +33,7 @@ while true; do
2733
fi
2834

2935
# Check that 4th block is produced to validate the application
30-
if ${BINARY_PATH} query comet block --type=height 4; then
36+
if ${BINARY_PATH} query block --type=height 4; then
3137
echo "Block #4 has been committed. Application is working correctly."
3238
kill $APP_PID
3339
exit 0

0 commit comments

Comments
 (0)