Skip to content

Commit

Permalink
Evm-533 Notifications to slack about nightly builds (#1339)
Browse files Browse the repository at this point in the history
Nightly build output to slack
  • Loading branch information
Nemanja0x authored Mar 28, 2023
1 parent 3b0e13b commit 26118f8
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ name: Build
on: # yamllint disable-line rule:truthy
workflow_dispatch:
workflow_call:
# Map the workflow outputs to job outputs
outputs:
build_output: ${{ jobs.go_build.outputs.build_output }}

jobs:
go_build:
name: Polygon Edge
runs-on: ubuntu-latest
outputs:
build_output: ${{ steps.edge_build.outputs.build_output }}
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -20,7 +25,8 @@ jobs:
go-version: 1.18.x

- name: Build Polygon Edge
run: go build -tags netgo -ldflags="-s -w -linkmode external -extldflags "-static" -X \"github.com/0xPolygon/polygon-edge/versioning.Version=${GITHUB_REF_NAME}\" -X \"github.com/0xPolygon/polygon-edge/versioning.Commit=${GITHUB_SHA}\"" && tar -czvf polygon-edge.tar.gz polygon-edge
- id: edge_build
run: echo "build_output=$(go build -tags netgo -ldflags="-s -w -linkmode external -extldflags "-static" -X \"github.com/0xPolygon/polygon-edge/versioning.Version=${GITHUB_REF_NAME}\" -X \"github.com/0xPolygon/polygon-edge/versioning.Commit=${GITHUB_SHA}\"" && tar -czvf polygon-edge.tar.gz polygon-edge)\n" >> $GITHUB_OUTPUT
env:
CC: gcc
CXX: g++
Expand All @@ -41,6 +47,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Go environment
uses: actions/setup-go@v3
with:
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,42 @@ jobs:
name: Polybft Property Tests
uses: ./.github/workflows/property-polybft.yml
needs: build

slack-notification:
name: Notify Slack
uses: slackapi/[email protected]
needs: [build, test, e2e, property]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEPLOYMENT_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
with:
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "Nightly Build Results"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Build details: ${{ needs.build.outputs.build_output }}"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Workflow: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Results>"
}
},
]
}

0 comments on commit 26118f8

Please sign in to comment.