From b55fca5fd7134d2203a34ea8710cfbb609a24193 Mon Sep 17 00:00:00 2001 From: Paul Razvan Berg Date: Mon, 16 Sep 2024 12:18:24 +0300 Subject: [PATCH] ci: slack notify integration (#1042) * ci: slack notify integration * ci: add to ci-fork --- .github/workflows/ci-deep.yml | 12 ++++++++++++ .github/workflows/ci-fork.yml | 36 +++++++++++++++++++++++------------ 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-deep.yml b/.github/workflows/ci-deep.yml index 27d53764d..4b579175e 100644 --- a/.github/workflows/ci-deep.yml +++ b/.github/workflows/ci-deep.yml @@ -74,3 +74,15 @@ jobs: foundry-profile: "test-optimized" match-path: "test/fork/**/*.sol" name: "Fork tests" + + notify-on-failure: + if: failure() # Runs only if a failure occurs in any previous jobs + runs-on: "ubuntu-latest" + steps: + - name: "Send Slack notification" + uses: "rtCamp/action-slack-notify@v2" + env: + SLACK_CHANNEL: "#ci-notifications" + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_USERNAME: "GitHub CI" + SLACK_MESSAGE: "CI Workflow failed for ${{ github.repository }} on branch ${{ github.ref }} at job ${{ github.job }}." diff --git a/.github/workflows/ci-fork.yml b/.github/workflows/ci-fork.yml index dbeaf273f..c85f5fbcf 100644 --- a/.github/workflows/ci-fork.yml +++ b/.github/workflows/ci-fork.yml @@ -1,8 +1,8 @@ name: "CI Fork and Util tests" on: - schedule: - - cron: "0 3 * * 1,3,5" # at 3:00 AM UTC on Monday, Wednesday and Friday + schedule: + - cron: "0 3 * * 1,3,5" # at 3:00 AM UTC on Monday, Wednesday and Friday jobs: lint: @@ -12,16 +12,16 @@ jobs: uses: "sablier-labs/reusable-workflows/.github/workflows/forge-build.yml@main" test-fork: - needs: ["lint", "build"] - secrets: - MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }} - uses: "sablier-labs/reusable-workflows/.github/workflows/forge-test.yml@main" - with: - foundry-fuzz-runs: 100 - foundry-profile: "test-optimized" - fuzz-seed: true - match-path: "test/fork/**/*.sol" - name: "Fork tests" + needs: ["lint", "build"] + secrets: + MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }} + uses: "sablier-labs/reusable-workflows/.github/workflows/forge-test.yml@main" + with: + foundry-fuzz-runs: 100 + foundry-profile: "test-optimized" + fuzz-seed: true + match-path: "test/fork/**/*.sol" + name: "Fork tests" test-utils: needs: ["lint", "build"] @@ -30,3 +30,15 @@ jobs: foundry-profile: "test-optimized" match-path: "test/utils/**/*.sol" name: "Utils tests" + + notify-on-failure: + if: failure() # Runs only if a failure occurs in any previous jobs + runs-on: "ubuntu-latest" + steps: + - name: "Send Slack notification" + uses: "rtCamp/action-slack-notify@v2" + env: + SLACK_CHANNEL: "#ci-notifications" + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_USERNAME: "GitHub CI" + SLACK_MESSAGE: "CI Workflow failed for ${{ github.repository }} on branch ${{ github.ref }} at job ${{ github.job }}."