Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/PIMOB-2217_Integrate_slack_message #253

Merged
merged 13 commits into from
Nov 15, 2023
127 changes: 127 additions & 0 deletions .github/workflows/slack-build-result.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Slack Build Result

on:
workflow_call:
inputs:
workflow:
description: workflow name
required: true
type: string
android-lint-result:
description: android lint result
required: true
type: string
ktlint-result:
description: ktlint result
required: true
type: string
assemble-result:
description: assemble result
required: true
type: string
unit-test-result:
description: unit test result
required: true
type: string
ui-test-result:
description: ui test result
required: true
type: string
jobs:
slack:
name: Slack Build Result for ${{ inputs.workflow }}
runs-on: ubuntu-latest
steps:
- name: Slack Build Result
uses: slackapi/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
LINT_RESULT: ${{ inputs.android-lint-result == 'failure' && ':x:' || ':white_check_mark:'}}
KTLINT_RESULT: ${{ inputs.ktlint-result == 'failure' && ':x:' || ':white_check_mark:'}}
ASSEMBLE_RESULT: ${{ inputs.assemble-result == 'failure' && ':x:' || ':white_check_mark:'}}
UNIT_TEST_RESULT: ${{ inputs.unit-test-result == 'failure' && ':x:' || ':white_check_mark:'}}
UI_TEST_RESULT: ${{ inputs.ui-test-result == 'failure' && ':x:' || ':white_check_mark:'}}



with:
channel-id: 'C0116ARL2NN'
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":android: Frame SDK build",
"emoji": true
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*See <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ inputs.workflow }} Full Results>*"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Branch* \n<${{ github.event.pull_request.html_url || github.event.head_commit.url }}|${{ github.event.pull_request.title }}>"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ format('{0} {1} {2}', env.LINT_RESULT, inputs.android-lint-result, 'Android Lint') }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ format('{0} {1} {2}', env.KTLINT_RESULT, inputs.ktlint-result, 'KTlint') }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ format('{0} {1} {2}', env.ASSEMBLE_RESULT, inputs.assemble-result, 'Assemble') }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ format('{0} {1} {2}', env.UNIT_TEST_RESULT, inputs.unit-test-result, 'Unit Test') }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ format('{0} {1} {2}', env.UI_TEST_RESULT, inputs.ui-test-result, 'UI Test') }}"
}
},
{
"type": "context",
"elements": [
{
"type": "plain_text",
"text": "Author: ${{ github.actor }}",
"emoji": true
}
]
},
{
"type": "divider"
}
]
}
12 changes: 12 additions & 0 deletions .github/workflows/verification-flow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,15 @@ jobs:
needs: android-lint
with:
module: ${{ inputs.module }}
slack-build-result:
uses: ./.github/workflows/slack-build-result.yml
secrets: inherit
needs: [ android-lint, ktlint, assemble, unit-test, ui-test ]
if: always()
with:
workflow: ${{ github.workflow }}
android-lint-result: ${{ needs.android-lint.result }}
ktlint-result: ${{ needs.ktlint.result }}
assemble-result: ${{ needs.assemble.result }}
unit-test-result: ${{ needs.unit-test.result }}
ui-test-result: ${{ needs.ui-test.result }}
1 change: 1 addition & 0 deletions .github/workflows/verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ concurrency:
jobs:
verify-module:
uses: ./.github/workflows/verification-flow.yml
secrets: inherit
with:
module: app
run-android-lint: true
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/verify-checkout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ concurrency:
jobs:
verify-module:
uses: ./.github/workflows/verification-flow.yml
secrets: inherit
with:
module: checkout
run-android-lint: true
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/verify-example-app-frames.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ concurrency:
jobs:
verify-module:
uses: ./.github/workflows/verification-flow.yml
secrets: inherit
with:
module: example_app_frames
run-android-lint: true
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/verify-frames.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ concurrency:
jobs:
verify-module:
uses: ./.github/workflows/verification-flow.yml
secrets: inherit
with:
module: frames
run-android-lint: true
Expand Down
3 changes: 2 additions & 1 deletion bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ workflows:
- install-missing-android-tools@3:
inputs:
- ndk_version: 21.0.6113669

- install-missing-android-tools@3:
inputs:
- gradlew_path: "$PROJECT_LOCATION/gradlew"
Expand Down Expand Up @@ -94,7 +95,7 @@ workflows:
set -e
# debug log
set -x

# Run sonarqube script
./scripts/sonar.sh
title: Script - Sonarqube
Expand Down