-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cardano-constitution-tests and slack-message-broker workflows (#6253
- Loading branch information
Showing
2 changed files
with
78 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This workflow runs the nighlty cardano-constitution tests | ||
|
||
name: "🗽 Cardano Constitution Tests" | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: 0 2 * * * # Daily at 2am | ||
|
||
jobs: | ||
run: | ||
name: Run | ||
runs-on: [self-hosted, plutus-benchmark] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
|
||
- name: Run Tests | ||
run: | | ||
pushd plutus-core | ||
nix run --no-warn-dirty --accept-flake-config .#cardano-constitution-test |
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# This workflow is triggered whenever any of the workflows listed in on.workflow_run.workflows | ||
# has been cancelled or has failed, and will send a message to the specified Slack channel ids. | ||
|
||
name: "📮 Slack Message Broker" | ||
|
||
on: | ||
workflow_run: | ||
types: [completed, requested, in_progress] | ||
workflows: | ||
- "🗽 Cardano Constitution Tests" | ||
- "💰 Cost Model Benchmark" | ||
- "🦕 Docusaurus Site" | ||
- "📜 Haddock Site" | ||
- "🩺 Longitudinal Benchmark" | ||
- "🔮 Metatheory Site" | ||
- "🌘 Nightly Testsuite" | ||
- "📝 Papers & Specs" | ||
|
||
jobs: | ||
Send: | ||
runs-on: [ubuntu-latest] | ||
if: contains(fromJson('["success", "failure", "null", "skipped", "cancelled", "action_required", "neutral", "timed_out"]'), github.event.workflow_job.conclusion) | ||
steps: | ||
- name: Prepare Slack Message | ||
uses: actions/github-script@main | ||
id: prepare-slack-message | ||
with: | ||
script: | | ||
const name = "${{ github.event.workflow_job.name }}"; | ||
const url = "${{ github.event.workflow_job.html_url }}"; | ||
const status = "${{ github.event.workflow_job.status }}"; | ||
const action = "${{ github.event.action }}"; | ||
const conclusion = "${{ github.event.workflow_job.conclusion }}"; | ||
const message = `Workflow ${name} - ${status} - ${action}: ${conclusion} 👉🏻 <${url}|view logs>`; | ||
core.setOutput("message", message); | ||
- name: Notify Slack | ||
uses: slackapi/slack-github-action@main | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
with: | ||
channel-id: C07A1GSNZEE | ||
payload: | | ||
{ | ||
"text": "${{ steps.prepare-slack-message.outputs.message }}", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "${{ steps.prepare-slack-message.outputs.message }}" | ||
} | ||
} | ||
] | ||
} | ||