Skip to content

Commit

Permalink
build: ci test
Browse files Browse the repository at this point in the history
  • Loading branch information
gbotrel committed Sep 13, 2024
1 parent 54bd7a0 commit ed17e3a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
1 change: 0 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ jobs:
status: ${{ needs.test.result }}
actor: ${{ github.actor }}
repository: ${{ github.repository }}
pr_title: ${{ github.event.pull_request.title }}
branch: ${{ github.event.pull_request.head.ref }}
run_id: ${{ github.run_id }}
failures: ${{ needs.test.outputs.failures }}
7 changes: 3 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,13 @@ jobs:
slack-notifications:
if: always()
needs:
- staticcheck
- test
uses: ./.github/workflows/slack-notifications.yml
secrets:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
status: ${{ needs.test.result }}
actor: ${{ github.actor }}
repository: ${{ github.repository }}
branch: ${{ github.ref_name }}
branch: ${{ github.event.pull_request.head.ref }}
run_id: ${{ github.run_id }}
failures: ${{ needs.test.outputs.failures }}
8 changes: 2 additions & 6 deletions .github/workflows/slack-notifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ on:
description: 'The GitHub repository'
required: true
type: string
pr_title:
description: 'Pull request title'
required: false
type: string
branch:
description: 'The branch name'
required: true
Expand All @@ -43,9 +39,9 @@ jobs:
- name: Post to Slack
run: |
if [ "${{ inputs.status }}" == "success" ]; then
payload="{\"channel\":\"team-gnark-build\",\"text\":\"GitHub Action build result: success\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":white_check_mark: *Workflow Succeeded*\"}},{\"type\":\"section\",\"fields\":[{\"type\":\"mrkdwn\",\"text\":\"*Actor:*\n${{ inputs.actor }}\"},{\"type\":\"mrkdwn\",\"text\":\"*Repository:*\n${{ inputs.repository }}\"},{\"type\":\"mrkdwn\",\"text\":\"*PR Title:*\n${{ inputs.pr_title }}\"},{\"type\":\"mrkdwn\",\"text\":\"*Branch:*\n${{ inputs.branch }}\"}]},{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*View Run:* <https://github.com/${{ inputs.repository }}/actions/runs/${{ inputs.run_id }}|View Details>\"}}]}"
payload="{\"channel\":\"team-gnark-build\",\"text\":\"GitHub Action build result: success\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":white_check_mark: ${{ inputs.repository }} *${{ inputs.branch }}*\"}},{\"type\":\"context\",\"elements\":[{\"type\":\"plain_text\",\"text\":\"Author: ${{ inputs.actor }}\",\"emoji\":true}]}]}"
else
payload="{\"channel\":\"team-gnark-build\",\"text\":\"GitHub Action build result: failure\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":red_circle: @${{ inputs.actor }} *${{ inputs.repository }}*\"}},{\"type\":\"section\",\"fields\":[{\"type\":\"mrkdwn\",\"text\":\"*PR:*\n${{ inputs.pr_title }}\"},{\"type\":\"mrkdwn\",\"text\":\"*Branch:*\n${{ inputs.branch }}\"}]},{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Failed Step:* <https://github.com/${{ inputs.repository }}/actions/runs/${{ inputs.run_id }}|View Details>\"}},{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Test Failure Details:* \n${{ inputs.failures }}\"}}]}"
payload="{\"channel\":\"team-gnark-build\",\"text\":\"GitHub Action build result: failure\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":red_circle: ${{ inputs.repository }} *${{ inputs.branch }}*\"}},{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Failed Step:* <https://github.com/${{ inputs.repository }}/actions/runs/${{ inputs.run_id }}|View Details>\"}},{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Test Failure Details:* ${{ inputs.failures }}\"}},{\"type\":\"context\",\"elements\":[{\"type\":\"plain_text\",\"text\":\"Author: ${{ inputs.actor }}\",\"emoji\":true}]}]}"
fi
curl -X POST -H 'Content-type: application/json; charset=utf-8' --data "$payload" https://slack.com/api/chat.postMessage -H "Authorization: Bearer ${{ secrets.SLACK_BOT_TOKEN }}"
shell: bash

0 comments on commit ed17e3a

Please sign in to comment.