Skip to content

Commit c6f9c55

Browse files
rokupsocornut
authored andcommitted
CI: Use our own discord notifier.
1 parent ae5b499 commit c6f9c55

File tree

2 files changed

+59
-49
lines changed

2 files changed

+59
-49
lines changed

.github/workflows/build.yml

+29-42
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,6 @@ jobs:
179179
shell: cmd
180180
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx12/example_win32_directx12.vcxproj /p:Platform=x64 /p:Configuration=Release'
181181

182-
- uses: sarisia/actions-status-discord@v1
183-
if: failure()
184-
with:
185-
webhook: ${{ secrets.DISCORD_CI_WEBHOOK }}
186-
username: GitHub Actions
187-
color: 0xFF0000
188-
title: ${{ github.job }}
189-
190182
Linux:
191183
runs-on: ubuntu-20.04
192184
steps:
@@ -318,15 +310,6 @@ jobs:
318310
- name: Build example_sdl_opengl3
319311
run: make -C examples/example_sdl_opengl3
320312

321-
# Use https://github.com/marketplace/actions/actions-status-discord to send status to Discord
322-
- uses: sarisia/actions-status-discord@v1
323-
if: failure()
324-
with:
325-
webhook: ${{ secrets.DISCORD_CI_WEBHOOK }}
326-
username: GitHub Actions
327-
color: 0xFF0000
328-
title: ${{ github.job }}
329-
330313
MacOS:
331314
runs-on: macOS-latest
332315
steps:
@@ -382,15 +365,6 @@ jobs:
382365
- name: Build example_apple_opengl2
383366
run: xcodebuild -project examples/example_apple_opengl2/example_apple_opengl2.xcodeproj -target example_osx_opengl2
384367

385-
# Use https://github.com/marketplace/actions/actions-status-discord to send status to Discord
386-
- uses: sarisia/actions-status-discord@v1
387-
if: failure()
388-
with:
389-
webhook: ${{ secrets.DISCORD_CI_WEBHOOK }}
390-
username: GitHub Actions
391-
color: 0xFF0000
392-
title: ${{ github.job }}
393-
394368
iOS:
395369
runs-on: macOS-latest
396370
steps:
@@ -403,15 +377,6 @@ jobs:
403377
# Code signing is required, but we disable it because it is irrelevant for CI builds.
404378
xcodebuild -project examples/example_apple_metal/example_apple_metal.xcodeproj -target example_apple_metal_ios CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
405379
406-
# Use https://github.com/marketplace/actions/actions-status-discord to send status to Discord
407-
- uses: sarisia/actions-status-discord@v1
408-
if: failure()
409-
with:
410-
webhook: ${{ secrets.DISCORD_CI_WEBHOOK }}
411-
username: GitHub Actions
412-
color: 0xFF0000
413-
title: ${{ github.job }}
414-
415380
Emscripten:
416381
runs-on: ubuntu-18.04
417382
steps:
@@ -434,11 +399,33 @@ jobs:
434399
popd
435400
make -C examples/example_emscripten
436401
437-
# Use https://github.com/marketplace/actions/actions-status-discord to send status to Discord
438-
- uses: sarisia/actions-status-discord@v1
439-
if: failure()
402+
Discord-CI:
403+
runs-on: ubuntu-18.04
404+
if: always()
405+
needs: [Windows, Linux, MacOS, iOS, Emscripten]
406+
steps:
407+
- uses: dearimgui/github_discord_notifier@latest
440408
with:
441-
webhook: ${{ secrets.DISCORD_CI_WEBHOOK }}
442-
username: GitHub Actions
443-
color: 0xFF0000
444-
title: ${{ github.job }}
409+
discord-webhook: ${{ secrets.DISCORD_CI_WEBHOOK }}
410+
github-token: ${{ github.token }}
411+
action-task: discord-jobs
412+
discord-filter: "'{{ github.branch }}'.match(/master|docking|tables/g) != null && '{{ run.conclusion }}' != '{{ last_run.conclusion }}'"
413+
discord-username: GitHub Actions
414+
discord-job-new-failure-message: ''
415+
discord-job-fixed-failure-message: ''
416+
discord-job-new-failure-embed: |
417+
{
418+
"title": "`{{ job.name }}` job is failing on `{{ github.branch }}`!",
419+
"description": "Commit [{{ github.context.payload.head_commit.title }}]({{ github.context.payload.head_commit.url }}) pushed to [{{ github.branch }}]({{ github.branch_url }}) broke [{{ job.name }}]({{ job.url }}) build job.\nFailing steps: {{ failing_steps }}",
420+
"url": "{{ job.url }}",
421+
"color": "0xFF0000",
422+
"timestamp": "{{ run.updated_at }}"
423+
}
424+
discord-job-fixed-failure-embed: |
425+
{
426+
"title": "`{{ github.branch }}` branch is no longer failing!",
427+
"description": "Build failures were fixed on [{{ github.branch }}]({{ github.branch_url }}) branch.",
428+
"color": "0x00FF00",
429+
"url": "{{ github.context.payload.head_commit.url }}",
430+
"timestamp": "{{ run.completed_at }}"
431+
}

.github/workflows/static-analysis.yml

+30-7
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,33 @@ jobs:
4242
pvs-studio-analyzer analyze -e ../../imstb_rectpack.h -e ../../imstb_textedit.h -e ../../imstb_truetype.h -l ../../pvs-studio.lic -o pvs-studio.log
4343
plog-converter -a 'GA:1,2;OP:1' -t errorfile -w pvs-studio.log
4444
45-
- uses: sarisia/actions-status-discord@v1
46-
if: failure()
47-
with:
48-
webhook: ${{ secrets.DISCORD_CI_WEBHOOK }}
49-
username: GitHub Actions
50-
color: 0xFF0000
51-
title: ${{ github.job }}
45+
Discord-CI:
46+
runs-on: ubuntu-18.04
47+
needs: [PVS-Studio]
48+
if: always()
49+
steps:
50+
- uses: dearimgui/github_discord_notifier@latest
51+
with:
52+
discord-webhook: ${{ secrets.DISCORD_CI_WEBHOOK }}
53+
github-token: ${{ github.token }}
54+
action-task: discord-jobs
55+
discord-filter: "'{{ github.branch }}'.match(/master|docking|tables/g) != null && '{{ run.conclusion }}' != '{{ last_run.conclusion }}'"
56+
discord-username: GitHub Actions
57+
discord-job-new-failure-message: ''
58+
discord-job-fixed-failure-message: ''
59+
discord-job-new-failure-embed: |
60+
{
61+
"title": "`{{ job.name }}` job is failing on `{{ github.branch }}`!",
62+
"description": "Commit [{{ github.context.payload.head_commit.title }}]({{ github.context.payload.head_commit.url }}) pushed to [{{ github.branch }}]({{ github.branch_url }}) broke static analysis [{{ job.name }}]({{ job.url }}) job.\nFailing steps: {{ failing_steps }}",
63+
"url": "{{ job.url }}",
64+
"color": "0xFF0000",
65+
"timestamp": "{{ run.updated_at }}"
66+
}
67+
discord-job-fixed-failure-embed: |
68+
{
69+
"title": "`{{ github.branch }}` branch is no longer failing!",
70+
"description": "Staic analysis failures were fixed on [{{ github.branch }}]({{ github.branch_url }}) branch.",
71+
"color": "0x00FF00",
72+
"url": "{{ github.context.payload.head_commit.url }}",
73+
"timestamp": "{{ run.completed_at }}"
74+
}

0 commit comments

Comments
 (0)