Skip to content

Commit

Permalink
Minor changes (#24)
Browse files Browse the repository at this point in the history
* Deploy Network

* Add Permissions

* Minor changes

* Concurrency change

* Destroy Network

* Minor changes

* Minor changes

* Fix commit sha

* Minor changes

* Add Tests

* Disable Tests temporarily

* Nightly Build

* Minor fixes

* Big changes

* Minor changes

* Minor changes

* Minor changes

* Notification fixes

* Notification changes

* Minor changes

* Permissions fixes

* Minor changes

* Notification changes

* Minor changes
  • Loading branch information
bane authored Jan 26, 2024
1 parent 8c958c8 commit eb4c42c
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/notification-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ jobs:
"type": "button",
"text": {
"type": "plain_text",
"text": "Logs"
"text": "${{ inputs.destroy_network_logs_output == '' && 'Logs' || 'No Logs' }}"
},
"style": "${{ inputs.destroy_network_logs_output == '' && env.succeed_bnt || env.failed_bnt }}",
"url": "https://s3.console.aws.amazon.com/s3/buckets/${{ secrets.AWS_S3_BLADE_BUCKET }}?region=${{ vars.AWS_REGION }}&prefix=logs/${{ github.run_id }}/"
}
]
Expand All @@ -144,7 +145,7 @@ jobs:
]
},
{
"color": "${{ inputs.unit_test_output == '' && inputs.fuzz_test_output == '' && inputs.e2e_legacy_test_output == '' && inputs.e2e_polybft_test_output && inputs.property_polybft_test_output == '' && env.green_color || env.red_color }}",
"color": "${{ inputs.unit_test_output == '' && inputs.fuzz_test_output == '' && inputs.e2e_legacy_test_output == '' && inputs.e2e_polybft_test_output == '' && inputs.property_polybft_test_output == '' && env.green_color || env.red_color }}",
"blocks": [
{
"type": "section",
Expand Down Expand Up @@ -180,7 +181,7 @@ jobs:
]
},
{
"color": "${{ inputs.destroy_network_logs_output == '' && inputs.destroy_network_terraform_output == '' && env.green_color || env.red_color }}",
"color": "${{ inputs.destroy_network_terraform_output == '' && env.green_color || env.red_color }}",
"blocks": [
{
"type": "section",
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/notification-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
name: Notification - Tests
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
unit_test_output:
description: Unit Tests output
type: string
required: true
e2e_polybft_test_output:
description: E2E PolyBFT Tests output
type: string
required: true
e2e_legacy_test_output:
description: E2E Legacy Tests output
type: string
required: true
property_polybft_test_output:
description: Property PolyBFT Tests output
type: string
required: true
fuzz_test_output:
description: Fuzz Tests output
type: string
required: true
secrets:
SLACK_WEBHOOK_URL:
required: true

jobs:
notification:
name: Notification
runs-on: ubuntu-latest
steps:
- name: Notify Slack
uses: slackapi/slack-github-action@v1.23.0
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
green_color: '#03C03C'
red_color: '#E60012'
succeed_bnt: 'primary'
failed_bnt: 'danger'
with:
payload: |
{
"attachments": [
{
"color": "${{ inputs.unit_test_output == '' && inputs.fuzz_test_output == '' && inputs.e2e_legacy_test_output == '' && inputs.e2e_polybft_test_output == '' && inputs.property_polybft_test_output == '' && env.green_color || env.red_color }}",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "Tests"
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Commit: *${{ github.sha }}*"
}
]
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Triggered by: *${{ github.triggering_actor }}*"
}
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Workflow Run"
},
"style": "${{ inputs.unit_test_output == '' && inputs.fuzz_test_output == '' && inputs.e2e_legacy_test_output == '' && inputs.e2e_polybft_test_output == '' && inputs.property_polybft_test_output == '' && env.succeed_bnt || env.failed_bnt }}",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
},
{
"color": "${{ inputs.unit_test_output == '' && inputs.fuzz_test_output == '' && inputs.e2e_legacy_test_output == '' && inputs.e2e_polybft_test_output == '' && inputs.property_polybft_test_output == '' && env.green_color || env.red_color }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Tests*\n${{ inputs.unit_test_output == '' && 'Unit' || '~Unit~' }}, ${{ inputs.fuzz_test_output == '' && 'Fuzz' || '~Fuzz~' }},\n${{ inputs.e2e_legacy_test_output == '' && 'E2E Legacy' || '~E2E Legacy~' }}, ${{ inputs.e2e_polybft_test_output == '' && 'E2E PolyBFT' || '~E2E PolyBFT~' }},\n${{ inputs.property_polybft_test_output == '' && 'Property PolyBFT' || '~Property PolyBFT~' }}"
}
}
]
}
]
}
]
}
]
}
13 changes: 13 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,16 @@ jobs:
name: Fuzz Tests
uses: ./.github/workflows/fuzz-test.yml
if: ${{ inputs.fuzz-test == true }}
notification:
name: Tests Notification
needs: [unit-test, e2e-polybft-test, e2e-legacy-test, property-polybft-test, fuzz-test]
uses: ./.github/workflows/notification-tests.yml
if: always() && github.event_name == 'workflow_dispatch'
with:
unit_test_output: ${{ needs.unit-test.outputs.workflow_output }}
e2e_polybft_test_output: ${{ needs.e2e-polybft-test.outputs.workflow_output }}
e2e_legacy_test_output: ${{ needs.e2e-legacy-test.outputs.workflow_output }}
property_polybft_test_output: ${{ needs.property-polybft-test.outputs.workflow_output }}
fuzz_test_output: ${{ needs.fuzz-test.outputs.workflow_output }}
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

0 comments on commit eb4c42c

Please sign in to comment.