From 341b3b0a4e695b0e390f74811901e6c464dc174d Mon Sep 17 00:00:00 2001 From: Dimitri Gnidash Date: Wed, 15 May 2024 13:29:48 -0400 Subject: [PATCH] #8513: Add slack notifications to All commits pipeline Use `failure` instead of checking for the step condition --- .github/actions/slack-report/action.yaml | 3 ++- .github/workflows/build-and-unit-tests.yaml | 5 +++++ .../workflows/fast-dispatch-build-and-unit-tests.yaml | 10 ++++++++++ .github/workflows/perf-models.yaml | 9 +++++---- .github/workflows/run-profiler-regression.yaml | 5 +++++ 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/actions/slack-report/action.yaml b/.github/actions/slack-report/action.yaml index be899e19987..017240c654d 100644 --- a/.github/actions/slack-report/action.yaml +++ b/.github/actions/slack-report/action.yaml @@ -9,7 +9,8 @@ inputs: runs: using: "composite" steps: - - name: Report Github Pipeline Status Slack Action + - name: Report Github Pipeline Status Slack Action + if: ${{ github.ref == 'refs/heads/main' }} uses: slackapi/slack-github-action@v1.26.0 with: payload: | diff --git a/.github/workflows/build-and-unit-tests.yaml b/.github/workflows/build-and-unit-tests.yaml index 69ff28e150e..c7f0bee3062 100644 --- a/.github/workflows/build-and-unit-tests.yaml +++ b/.github/workflows/build-and-unit-tests.yaml @@ -42,3 +42,8 @@ jobs: run: | source ${{ github.workspace }}/python_env/bin/activate ./tests/scripts/run_tests.sh --tt-arch $ARCH_NAME --pipeline-type post_commit --dispatch-mode slow + - uses: ./.github/actions/slack-report + if: ${{ failure() }} + with: + slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} + owner: U0593J2RQRZ # Bill Teng diff --git a/.github/workflows/fast-dispatch-build-and-unit-tests.yaml b/.github/workflows/fast-dispatch-build-and-unit-tests.yaml index f28f3a6caa9..1d5e5382a62 100644 --- a/.github/workflows/fast-dispatch-build-and-unit-tests.yaml +++ b/.github/workflows/fast-dispatch-build-and-unit-tests.yaml @@ -61,6 +61,11 @@ jobs: cd $TT_METAL_HOME export PYTHONPATH=$TT_METAL_HOME ${{ matrix.test-group.cmd }} + - uses: ./.github/actions/slack-report + if: ${{ failure() }} + with: + slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} + owner: U0593J2RQRZ # Bill Teng multi-queue-single-device-tests: strategy: # Do not fail-fast because we need to ensure all tests go to completion @@ -98,3 +103,8 @@ jobs: source ${{ github.workspace }}/python_env/bin/activate export PYTHONPATH=$TT_METAL_HOME ./tests/scripts/run_tests.sh --tt-arch $ARCH_NAME --pipeline-type post_commit --dispatch-mode fast-multi-queue-single-device + - uses: ./.github/actions/slack-report + if: ${{ failure() }} + with: + slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} + owner: U0593J2RQRZ # Bill Teng diff --git a/.github/workflows/perf-models.yaml b/.github/workflows/perf-models.yaml index eb1bdbfbbb7..8c423e865c1 100644 --- a/.github/workflows/perf-models.yaml +++ b/.github/workflows/perf-models.yaml @@ -56,10 +56,11 @@ jobs: run: | source ${{ github.workspace }}/python_env/bin/activate ./tests/scripts/run_tests.sh --tt-arch $ARCH_NAME --pipeline-type ${{ matrix.model-type }}_models_performance_${{ matrix.test-info.machine-type }} - - uses: ./.github/actions/slack-report - if: ${{ steps.performance_tests.outcome != 'success' }} - with: - slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} + # TODO: Fix the pipeline before enabling notifications. + #- uses: ./.github/actions/slack-report + # if: ${{ failure() }} + # with: + # slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} - name: Check perf report exists id: check-perf-report if: ${{ !cancelled() }} diff --git a/.github/workflows/run-profiler-regression.yaml b/.github/workflows/run-profiler-regression.yaml index b383616bfea..27a97c17c4c 100644 --- a/.github/workflows/run-profiler-regression.yaml +++ b/.github/workflows/run-profiler-regression.yaml @@ -38,3 +38,8 @@ jobs: timeout-minutes: 30 run: | ./tests/scripts/run_profiler_regressions.sh + - uses: ./.github/actions/slack-report + if: ${{ failure() }} + with: + slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} + owner: U0593J2RQRZ # Bill Teng