Skip to content

Commit

Permalink
Add cardano-constitution-tests and slack-message-broker workflows (#6253
Browse files Browse the repository at this point in the history
)
  • Loading branch information
zeme-wana authored Jun 27, 2024
1 parent 30402a4 commit e8f9389
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/cardano-constitution-tests.yml
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
57 changes: 57 additions & 0 deletions .github/workflows/slake-message-broker.yml
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 }}"
}
}
]
}

0 comments on commit e8f9389

Please sign in to comment.