Skip to content

Commit

Permalink
chore: update ci YML
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath committed Sep 22, 2024
1 parent 574adba commit 9128ff0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 31 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -473,15 +473,3 @@ jobs:

- name: Update Homebrew Formula
run: ./update-formula.sh ${{needs.draft_release.outputs.create_release_name }}

failure-notification:
runs-on: ubuntu-latest
steps:
- name: Notify failure on Discord
if: ${{ always() && contains(needs.*.result, 'failure') }}
uses: discord-actions/message@v2
with:
webhookUrl: ${{ secrets.DISCORD_WEBHOOK_URL }}
message: |
Build failed on branch: ${{ github.ref }}
Link: ${{ github.repository }}/actions/runs/${{ github.run_id }}
42 changes: 23 additions & 19 deletions .github/workflows/discord.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
name: Notify on Workflow Failure and Fix

on:
push:
branches:
- main
workflow_run:
workflows: ["*"] # This listens to all workflows
workflows: ["*"]
types:
- completed

jobs:
notify:
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
runs-on: ubuntu-latest
steps:
- name: Check Previous Run Status
Expand All @@ -23,46 +27,46 @@ jobs:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
run: |
curl -H "Content-Type: application/json" \
-X POST \
-d '{
-X POST \
-d '{
"content": "**Workflow Failure Detected on Main Branch** :x:",
"embeds": [
{
{
"author": {
"name": "GitHub Actions Bot",
"icon_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
"url": "https://github.com/${{ github.repository }}"
"name": "GitHub Actions Bot",
"icon_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
"url": "https://github.com/${{ github.repository }}"
},
"title": "Workflow: '${{ github.event.workflow_run.name }}'",
"description": "The workflow **${{ github.event.workflow_run.name }}** has failed on the main branch.",
"url": "${{ github.event.workflow_run.html_url }}",
"color": 15158332
}
}
]
}' \
$DISCORD_WEBHOOK_URL
}' \
$DISCORD_WEBHOOK_URL
- name: Send Discord Notification on Fix
if: ${{ github.event.workflow_run.conclusion == 'success' && env.previous_status == 'failure' }}
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
run: |
curl -H "Content-Type: application/json" \
-X POST \
-d '{
-X POST \
-d '{
"content": "**Workflow Fixed on Main Branch** :white_check_mark:",
"embeds": [
{
{
"author": {
"name": "GitHub Actions Bot",
"icon_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
"url": "https://github.com/${{ github.repository }}"
"name": "GitHub Actions Bot",
"icon_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
"url": "https://github.com/${{ github.repository }}"
},
"title": "Workflow: '${{ github.event.workflow_run.name }}' Fixed",
"description": "The workflow **${{ github.event.workflow_run.name }}** has been fixed on the main branch.",
"url": "${{ github.event.workflow_run.html_url }}",
"color": 3066993
}
}
]
}' \
$DISCORD_WEBHOOK_URL
}' \
$DISCORD_WEBHOOK_URL

1 comment on commit 9128ff0

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running 30s test @ http://localhost:8000/graphql

4 threads and 100 connections

Thread Stats Avg Stdev Max +/- Stdev
Latency 11.68ms 5.88ms 270.80ms 94.49%
Req/Sec 2.18k 258.97 3.04k 83.83%

260873 requests in 30.03s, 1.31GB read

Requests/sec: 8687.06

Transfer/sec: 44.59MB

Please sign in to comment.