From 3fb6b106b75e716059ec96ef78cb74f82ff96e54 Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Tue, 16 Jul 2024 10:24:55 -0600 Subject: [PATCH] chore(github): add slack webhook to tests --- .github/workflows/build.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e82e89c5..875b3162 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,16 +31,13 @@ jobs: test: runs-on: ubuntu-latest - strategy: - matrix: - node_version: [18.x] steps: - uses: actions/checkout@v4 - name: Set Up node uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node_version }} + node-version-file: .nvmrc cache: 'yarn' - name: Install dependencies @@ -53,3 +50,19 @@ jobs: uses: codecov/codecov-action@v4.0.1 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + - name: Send Slack failure notification + if: failure() && (github.event_name == 'pull_request' && (github.base_ref == 'main' || github.base_ref == 'alpha')) + env: + SLACK_TITLE: Build / E2E tests failed! + SLACK_COLOR: danger + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + uses: rtCamp/action-slack-notify@v2 + + - name: Send Slack success notification + if: success() && (github.event_name == 'pull_request' && (github.base_ref == 'main' || github.base_ref == 'alpha')) + env: + SLACK_TITLE: Build / E2E tests succeeded! + SLACK_COLOR: good + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + uses: rtCamp/action-slack-notify@v2