diff --git a/.github/workflows/slack-build-result.yml b/.github/workflows/slack-build-result.yml new file mode 100644 index 00000000..25bdb383 --- /dev/null +++ b/.github/workflows/slack-build-result.yml @@ -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/slack-github-action@v1.24.0 + 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" + } + ] + } diff --git a/.github/workflows/verification-flow.yml b/.github/workflows/verification-flow.yml index 7195c150..14d9510a 100644 --- a/.github/workflows/verification-flow.yml +++ b/.github/workflows/verification-flow.yml @@ -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 }} diff --git a/.github/workflows/verify-app.yml b/.github/workflows/verify-app.yml index 5d5d003e..64ce625b 100644 --- a/.github/workflows/verify-app.yml +++ b/.github/workflows/verify-app.yml @@ -21,6 +21,7 @@ concurrency: jobs: verify-module: uses: ./.github/workflows/verification-flow.yml + secrets: inherit with: module: app run-android-lint: true diff --git a/.github/workflows/verify-checkout.yml b/.github/workflows/verify-checkout.yml index 6ceb0c37..cbed3f86 100644 --- a/.github/workflows/verify-checkout.yml +++ b/.github/workflows/verify-checkout.yml @@ -19,6 +19,7 @@ concurrency: jobs: verify-module: uses: ./.github/workflows/verification-flow.yml + secrets: inherit with: module: checkout run-android-lint: true diff --git a/.github/workflows/verify-example-app-frames.yml b/.github/workflows/verify-example-app-frames.yml index 12dd8fcf..76267911 100644 --- a/.github/workflows/verify-example-app-frames.yml +++ b/.github/workflows/verify-example-app-frames.yml @@ -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 diff --git a/.github/workflows/verify-frames.yml b/.github/workflows/verify-frames.yml index 5a6f87c0..489a6864 100644 --- a/.github/workflows/verify-frames.yml +++ b/.github/workflows/verify-frames.yml @@ -20,6 +20,7 @@ concurrency: jobs: verify-module: uses: ./.github/workflows/verification-flow.yml + secrets: inherit with: module: frames run-android-lint: true diff --git a/bitrise.yml b/bitrise.yml index 4cfe087f..b0470d5e 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -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" @@ -94,7 +95,7 @@ workflows: set -e # debug log set -x - + # Run sonarqube script ./scripts/sonar.sh title: Script - Sonarqube