CI: Use our own discord notifier.

This commit is contained in:
Rokas Kupstys 2020-10-08 15:06:46 +03:00 committed by ocornut
parent ae5b4991be
commit c6f9c558ec
2 changed files with 59 additions and 49 deletions

View File

@ -179,14 +179,6 @@ jobs:
shell: cmd shell: cmd
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx12/example_win32_directx12.vcxproj /p:Platform=x64 /p:Configuration=Release' run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx12/example_win32_directx12.vcxproj /p:Platform=x64 /p:Configuration=Release'
- uses: sarisia/actions-status-discord@v1
if: failure()
with:
webhook: ${{ secrets.DISCORD_CI_WEBHOOK }}
username: GitHub Actions
color: 0xFF0000
title: ${{ github.job }}
Linux: Linux:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
@ -318,15 +310,6 @@ jobs:
- name: Build example_sdl_opengl3 - name: Build example_sdl_opengl3
run: make -C examples/example_sdl_opengl3 run: make -C examples/example_sdl_opengl3
# Use https://github.com/marketplace/actions/actions-status-discord to send status to Discord
- uses: sarisia/actions-status-discord@v1
if: failure()
with:
webhook: ${{ secrets.DISCORD_CI_WEBHOOK }}
username: GitHub Actions
color: 0xFF0000
title: ${{ github.job }}
MacOS: MacOS:
runs-on: macOS-latest runs-on: macOS-latest
steps: steps:
@ -382,15 +365,6 @@ jobs:
- name: Build example_apple_opengl2 - name: Build example_apple_opengl2
run: xcodebuild -project examples/example_apple_opengl2/example_apple_opengl2.xcodeproj -target example_osx_opengl2 run: xcodebuild -project examples/example_apple_opengl2/example_apple_opengl2.xcodeproj -target example_osx_opengl2
# Use https://github.com/marketplace/actions/actions-status-discord to send status to Discord
- uses: sarisia/actions-status-discord@v1
if: failure()
with:
webhook: ${{ secrets.DISCORD_CI_WEBHOOK }}
username: GitHub Actions
color: 0xFF0000
title: ${{ github.job }}
iOS: iOS:
runs-on: macOS-latest runs-on: macOS-latest
steps: steps:
@ -403,15 +377,6 @@ jobs:
# Code signing is required, but we disable it because it is irrelevant for CI builds. # Code signing is required, but we disable it because it is irrelevant for CI builds.
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 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
# Use https://github.com/marketplace/actions/actions-status-discord to send status to Discord
- uses: sarisia/actions-status-discord@v1
if: failure()
with:
webhook: ${{ secrets.DISCORD_CI_WEBHOOK }}
username: GitHub Actions
color: 0xFF0000
title: ${{ github.job }}
Emscripten: Emscripten:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
@ -434,11 +399,33 @@ jobs:
popd popd
make -C examples/example_emscripten make -C examples/example_emscripten
# Use https://github.com/marketplace/actions/actions-status-discord to send status to Discord Discord-CI:
- uses: sarisia/actions-status-discord@v1 runs-on: ubuntu-18.04
if: failure() if: always()
needs: [Windows, Linux, MacOS, iOS, Emscripten]
steps:
- uses: dearimgui/github_discord_notifier@latest
with: with:
webhook: ${{ secrets.DISCORD_CI_WEBHOOK }} discord-webhook: ${{ secrets.DISCORD_CI_WEBHOOK }}
username: GitHub Actions github-token: ${{ github.token }}
color: 0xFF0000 action-task: discord-jobs
title: ${{ github.job }} discord-filter: "'{{ github.branch }}'.match(/master|docking|tables/g) != null && '{{ run.conclusion }}' != '{{ last_run.conclusion }}'"
discord-username: GitHub Actions
discord-job-new-failure-message: ''
discord-job-fixed-failure-message: ''
discord-job-new-failure-embed: |
{
"title": "`{{ job.name }}` job is failing on `{{ github.branch }}`!",
"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 }}",
"url": "{{ job.url }}",
"color": "0xFF0000",
"timestamp": "{{ run.updated_at }}"
}
discord-job-fixed-failure-embed: |
{
"title": "`{{ github.branch }}` branch is no longer failing!",
"description": "Build failures were fixed on [{{ github.branch }}]({{ github.branch_url }}) branch.",
"color": "0x00FF00",
"url": "{{ github.context.payload.head_commit.url }}",
"timestamp": "{{ run.completed_at }}"
}

View File

@ -42,10 +42,33 @@ jobs:
pvs-studio-analyzer analyze -e ../../imstb_rectpack.h -e ../../imstb_textedit.h -e ../../imstb_truetype.h -l ../../pvs-studio.lic -o pvs-studio.log pvs-studio-analyzer analyze -e ../../imstb_rectpack.h -e ../../imstb_textedit.h -e ../../imstb_truetype.h -l ../../pvs-studio.lic -o pvs-studio.log
plog-converter -a 'GA:1,2;OP:1' -t errorfile -w pvs-studio.log plog-converter -a 'GA:1,2;OP:1' -t errorfile -w pvs-studio.log
- uses: sarisia/actions-status-discord@v1 Discord-CI:
if: failure() runs-on: ubuntu-18.04
with: needs: [PVS-Studio]
webhook: ${{ secrets.DISCORD_CI_WEBHOOK }} if: always()
username: GitHub Actions steps:
color: 0xFF0000 - uses: dearimgui/github_discord_notifier@latest
title: ${{ github.job }} with:
discord-webhook: ${{ secrets.DISCORD_CI_WEBHOOK }}
github-token: ${{ github.token }}
action-task: discord-jobs
discord-filter: "'{{ github.branch }}'.match(/master|docking|tables/g) != null && '{{ run.conclusion }}' != '{{ last_run.conclusion }}'"
discord-username: GitHub Actions
discord-job-new-failure-message: ''
discord-job-fixed-failure-message: ''
discord-job-new-failure-embed: |
{
"title": "`{{ job.name }}` job is failing on `{{ github.branch }}`!",
"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 }}",
"url": "{{ job.url }}",
"color": "0xFF0000",
"timestamp": "{{ run.updated_at }}"
}
discord-job-fixed-failure-embed: |
{
"title": "`{{ github.branch }}` branch is no longer failing!",
"description": "Staic analysis failures were fixed on [{{ github.branch }}]({{ github.branch_url }}) branch.",
"color": "0x00FF00",
"url": "{{ github.context.payload.head_commit.url }}",
"timestamp": "{{ run.completed_at }}"
}