Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cardano-constitution-tests and slack-message-broker workflows #6253

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}"
}
}
]
}