From 287aa75a2166c0ff74e8db945770313bfbbba2b6 Mon Sep 17 00:00:00 2001 From: Sebastiaan Huber Date: Wed, 13 Jul 2022 11:18:47 +0200 Subject: [PATCH] DevOps: Add a notification for nightly workflow on fail When the `nightly.yml` workflow fails it will now send a notification to the `dev-aiida-core` channel on the AiiDA Slack. --- .github/workflows/nightly.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 23469a9fcf..520cd68c1a 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -62,6 +62,7 @@ jobs: run: sudo apt update && sudo apt install postgresql - name: Install aiida-core + id: install run: | pip install -r requirements/requirements-py-${{ matrix.python-version }}.txt pip install --no-deps -e . @@ -71,4 +72,16 @@ jobs: run: .github/workflows/setup.sh - name: Run tests + id: tests run: .github/workflows/tests_nightly.sh + + - name: Slack notification + if: always() && (steps.install.outcome == 'Failure' || steps.tests.outcome == 'Failure') + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_ICON: https://www.materialscloud.org/discover/images/0ba0a17d.aiida-logo-128.png + SLACK_CHANNEL: dev-aiida-core + SLACK_COLOR: b60205 + SLACK_TITLE: "Nightly build of `aiida-core/main` failed" + SLACK_MESSAGE: "The tests of the `nightly.yml` GHA worklow failed."