From b00b550a1b5816d1c6e33788e2f19839acbcac3b Mon Sep 17 00:00:00 2001 From: Paul Latzelsperger Date: Thu, 24 Oct 2024 14:00:43 +0200 Subject: [PATCH] TEST post to discord on scheduled builds --- .github/workflows/run-e2e-tests.yml | 32 ++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-e2e-tests.yml b/.github/workflows/run-e2e-tests.yml index 15998f73..1d3e1ea0 100644 --- a/.github/workflows/run-e2e-tests.yml +++ b/.github/workflows/run-e2e-tests.yml @@ -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: @@ -34,7 +34,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true - jobs: Run-E2E-Tests: runs-on: ubuntu-latest @@ -117,4 +116,31 @@ jobs: - name: "Destroy the KinD cluster" run: >- - kind delete cluster -n dcp-demo \ No newline at end of file + 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 \ No newline at end of file