-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Quicker missing op notifications (#84)
Updates the missing ops slack notifier to run daily, so we find the errors quicker. We use the new workflow from CQCL/hugrverse-actions#18 to add a one-week timeout, so we don't spam the chat. The notification step was actually broken on `main`. This PR adds a `continue-on-error` flag on the test job so it doesn't get skipped the notification when it fails.
- Loading branch information
Showing
1 changed file
with
17 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,8 @@ on: | |
- main | ||
workflow_dispatch: {} | ||
schedule: | ||
# 08:00 weekly on Monday | ||
- cron: '0 8 * * 1' | ||
# 08:00 daily | ||
- cron: '0 8 * * *' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
@@ -21,6 +21,7 @@ jobs: | |
missing-optypes: | ||
name: Check for missing op type definitions | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
outputs: | ||
should_notify: ${{ steps.check_status.outputs.result }} | ||
steps: | ||
|
@@ -54,20 +55,18 @@ jobs: | |
result-encoding: string | ||
|
||
notify-slack: | ||
uses: CQCL/hugrverse-actions/.github/workflows/slack-notifier.yml@main | ||
needs: missing-optypes | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.missing-optypes.outputs.should_notify == 'true' && github.event_name == 'schedule' }} | ||
steps: | ||
- name: Compose the slack message | ||
id: make_msg | ||
run: | | ||
MSG="msg=`tket-json-rs` is missing OpType definitions. See the failing check for more info.\nhttps://github.com/CQCL/tket-json-rs/actions/workflows/missing-ops.yml" | ||
echo $MSG | ||
echo $MSG >> "$GITHUB_OUTPUT" | ||
- name: Send notification | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: 'C040CRWH9FF' | ||
slack-message: ${{ steps.make_msg.outputs.msg }} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
if: ${{ needs.missing-optypes.outputs.should_notify == 'true' && ( github.event_name == 'schedule' || github.event_name == 'push' ) }} | ||
with: | ||
channel-id: 'C040CRWH9FF' | ||
slack-message: | | ||
⚠️ `tket-json-rs` is missing OpType definitions. | ||
See <https://github.com/CQCL/tket-json-rs/actions/runs/${{ github.run_id }}|the failing check> for more info. | ||
# Rate-limit the message to once per week | ||
timeout-minutes: 10080 | ||
# A repository variable used to store the last message timestamp. | ||
timeout-variable: "MISSING_OPS_MSG_SENT" | ||
secrets: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
GITHUB_PAT: ${{ secrets.HUGRBOT_PAT }} |