Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): post to discord on scheduled builds #368

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions .github/workflows/run-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
branches:
- main
schedule:
- cron: "0 0 * * *" # once a day (1:30 UTC)
- cron: "0 5 * * *" # once a day

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -34,7 +34,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
Run-E2E-Tests:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -117,4 +116,31 @@ jobs:

- name: "Destroy the KinD cluster"
run: >-
kind delete cluster -n dcp-demo
kind delete cluster -n dcp-demo

Secrets-Presence:
name: "Check for required credentials"
runs-on: ubuntu-latest
outputs:
HAS_WEBHOOK: ${{ steps.secrets-presence.outputs.HAS_WEBHOOK }}
steps:
- name: Check whether secrets exist
id: secrets-presence
run: |
[ ! -z "${{ secrets.DISCORD_GITHUB_CI_WEBHOOK }}" ] && echo "HAS_WEBHOOK=true" >> $GITHUB_OUTPUT
exit 0

Post-To-Discord:
needs: [ Run-E2E-Tests, Secrets-Presence ]
if: "needs.Secrets-Presence.outputs.HAS_WEBHOOK && always() && github.event_name == 'schedule'"
runs-on: ubuntu-latest
steps:
- uses: sarisia/actions-status-discord@v1
name: "Post discord webhook"
with:
webhook: ${{ secrets.DISCORD_GITHUB_CI_WEBHOOK }}
# if the publishing is skipped, that means the preceding test run failed
status: ${{ needs.Run-E2E-Tests.result == 'skipped' && 'Failure' || needs.Run-E2E-Tests.result }}
title: "Nightly MVD E2E-Test"
description: Nightly E2E test run against the latest artefacts"
username: GitHub Actions
Loading