Skip to content

Commit

Permalink
ci: send notifications to teams channel (#895)
Browse files Browse the repository at this point in the history
  • Loading branch information
miampf authored Oct 4, 2024
1 parent 6d69ac4 commit 9458437
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/actions/post_to_teams/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Post to teams
description: Post a message to the teams channel

inputs:
webhook:
description: "The webhook to send the message to."
required: true
message:
description: "The message to be sent. Note that you may not use quotes or escaped quotes in your message."
required: true
runs:
using: "composite"
steps:
- name: Post to teams
shell: bash
run: |
run_url="${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"
payload="$(printf '{"workflow_name": "%s", "job_id": "%s", "run_id": "%s", "ref": "%s", "message": "%s", "run_url": "%s"}' \
"${{github.workflow}}" "${{github.job}}" "${{github.run_id}}" "${{github.ref_name}}" "${{inputs.message}}" "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}")"
curl \
-H "Content-Type: application/json" \
-d "$payload" \
"${{inputs.webhook}}"
6 changes: 6 additions & 0 deletions .github/workflows/e2e_regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ jobs:
with:
name: e2e_pod_logs-${{ matrix.case }}
path: workspace/namespace-logs
- name: Notify teams channel of failure
if: ${{ failure() && github.ref == 'main' }}
uses: ./.github/actions/post_to_teams
with:
webhook: ${{ secrets.TEAMS_CI_WEBHOOK }}
message: "Regression test failed"
- name: Cleanup
if: cancelled() && !inputs.skip-undeploy
run: |
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/e2e_runtime-reproducibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: e2e test runtime reproducibility
on:
workflow_dispatch:
schedule:
- cron: '0 19 * * 0' # 7pm UTC on Sundays
- cron: "0 19 * * 0" # 7pm UTC on Sundays

jobs:
os-matrix:
Expand Down Expand Up @@ -50,6 +50,12 @@ jobs:
with:
name: ${{ matrix.build-target }}-${{ matrix.os }}-rebuild
path: rebuild
- name: Notify teams channel of failure
if: ${{ failure() && github.ref == 'main' }}
uses: ./.github/actions/post_to_teams
with:
webhook: ${{ secrets.TEAMS_CI_WEBHOOK }}
message: "Runtime reproducibility test failed on ${{ matrix.build-target }}-${{ matrix.os }}"

collect-checksums:
runs-on: ubuntu-22.04
Expand All @@ -76,3 +82,9 @@ jobs:
exit(1)
print("All checksums were equal")
- name: Notify teams channel of failure
if: ${{ failure() && github.ref == 'main' }}
uses: ./.github/actions/post_to_teams
with:
webhook: ${{ secrets.TEAMS_CI_WEBHOOK }}
message: "Runtime reproducibility test failed to collect checksums"
8 changes: 7 additions & 1 deletion .github/workflows/rpm_updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: update rpm packages
on:
workflow_dispatch:
schedule:
- cron: '0 19 * * 0' # 7pm UTC on Sundays
- cron: "0 19 * * 0" # 7pm UTC on Sundays

jobs:
update-rpm-packages:
Expand Down Expand Up @@ -36,3 +36,9 @@ jobs:
committer: edgelessci <[email protected]>
author: edgelessci <[email protected]>
token: ${{ secrets.NUNKI_CI_COMMIT_PUSH_PR }}
- name: Notify teams channel of failure
if: ${{ failure() && github.ref == 'main' }}
uses: ./.github/actions/post_to_teams
with:
webhook: ${{ secrets.TEAMS_CI_WEBHOOK }}
message: "Updating RPM packages failed"

0 comments on commit 9458437

Please sign in to comment.