From 0b3e27f1487cbcc59f22e075e4268be444702bdc Mon Sep 17 00:00:00 2001 From: zeme Date: Mon, 24 Jun 2024 15:07:34 +0200 Subject: [PATCH] Done --- ...heck-changelog.yml => changelog-label.yml} | 27 ++++++---- .github/workflows/cost-model-bench.yml | 35 ------------- .github/workflows/cost-model-benchmark.yml | 30 ++++++++++++ .github/workflows/docusaurus-site.yml | 4 +- .github/workflows/haddock-site.yml | 4 +- .github/workflows/longitudinal-benchmark.yml | 40 +++++++-------- .../{benchmark.yml => manual-benchmark.yml} | 32 +++++++----- .github/workflows/metatheory-site.yml | 11 ++--- .../{nightly.yml => nightly-testsuite.yml} | 19 ++++--- .github/workflows/plutus-tx-template.yml | 20 ++++---- .github/workflows/script-evaluation-test.yml | 49 ------------------- .github/workflows/slack-message-broker.yml | 47 ------------------ ...{add-triage-label.yml => triage-label.yml} | 26 +++++----- 13 files changed, 127 insertions(+), 217 deletions(-) rename .github/workflows/{check-changelog.yml => changelog-label.yml} (75%) delete mode 100644 .github/workflows/cost-model-bench.yml create mode 100644 .github/workflows/cost-model-benchmark.yml rename .github/workflows/{benchmark.yml => manual-benchmark.yml} (85%) rename .github/workflows/{nightly.yml => nightly-testsuite.yml} (62%) delete mode 100644 .github/workflows/script-evaluation-test.yml delete mode 100644 .github/workflows/slack-message-broker.yml rename .github/workflows/{add-triage-label.yml => triage-label.yml} (78%) diff --git a/.github/workflows/check-changelog.yml b/.github/workflows/changelog-label.yml similarity index 75% rename from .github/workflows/check-changelog.yml rename to .github/workflows/changelog-label.yml index 55ca7acb059..81f074be53c 100644 --- a/.github/workflows/check-changelog.yml +++ b/.github/workflows/changelog-label.yml @@ -1,23 +1,32 @@ -name: Check Changelog +# This job enforces that: either some changelog.d/** files were added by the +# PR, or the PR has the "No Changelog Required" label. + +name: "🏷️ Changelog Label" + on: pull_request: - types: [ opened, synchronize, labeled, unlabeled ] + types: [ opened, reopened, synchronize, labeled, unlabeled ] + jobs: - check-changelog: + + check: + name: Check runs-on: [ubuntu-latest] + permissions: + issues: write steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@main - - name: Find Changed Files in changelog.d + - name: Find Changed Files id: changed-files - uses: tj-actions/changed-files@v44 + uses: tj-actions/changed-files@main with: files: '**/changelog.d/**' - - name: Enforce New File or 'No Changelog Required' Label - uses: actions/github-script@v7 - # don't require changelogs for draft PRs + - name: Enforce Label + uses: actions/github-script@main + # Don't require changelogs for draft PRs if: github.event.pull_request.draft == false with: script: | diff --git a/.github/workflows/cost-model-bench.yml b/.github/workflows/cost-model-bench.yml deleted file mode 100644 index 5b92e4896ab..00000000000 --- a/.github/workflows/cost-model-bench.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: "Cost model benchmark" - -on: - workflow_dispatch: - inputs: - extraBenchArgs: - description: 'extra argument(s) to pass to the cost-model-budgeting-bench command' - default: '' - type: string - -jobs: - bench: - name: Cost model benchmark - - runs-on: [self-hosted, plutus-benchmark] - - timeout-minutes: 14400 - - steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@V27 - with: - extra_nix_config: | - experimental-features = nix-command flakes - - - name: Run benchmarks - run: nix --accept-flake-config run .#cost-model-budgeting-bench -- --csv results.csv ${{ inputs.extraBenchArgs }} - - - name: Upload results - uses: actions/upload-artifact@v4 - with: - name: results - path: results.csv - if-no-files-found: error diff --git a/.github/workflows/cost-model-benchmark.yml b/.github/workflows/cost-model-benchmark.yml new file mode 100644 index 00000000000..85e397ad5bd --- /dev/null +++ b/.github/workflows/cost-model-benchmark.yml @@ -0,0 +1,30 @@ +# This workflow runs the cost model benchmark and uploads the results as a +# GitHub artifact. + +name: "💰 Cost Model Benchmark" + +on: + workflow_dispatch: + inputs: + entra-bench-args: + description: 'extra argument(s) to pass to the cost-model-budgeting-bench command' + default: '' + type: string + +jobs: + run: + name: Run + runs-on: [self-hosted, plutus-benchmark] + steps: + - name: Checkout + uses: actions/checkout@main + + - name: Run Benchmark + run: nix --accept-flake-config run .#cost-model-budgeting-bench -- --csv results.csv ${{ inputs.entra-bench-args }} + + - name: Upload Results + uses: actions/upload-artifact@main + with: + name: results + path: results.csv + if-no-files-found: error diff --git a/.github/workflows/docusaurus-site.yml b/.github/workflows/docusaurus-site.yml index 6297e8464e5..8595a4c10b1 100644 --- a/.github/workflows/docusaurus-site.yml +++ b/.github/workflows/docusaurus-site.yml @@ -1,7 +1,7 @@ # This workflow builds and publishes the Docusaurus site to: # https://intersectmbo.github.io/plutus/docs -name: "🦕 Deploy Docusaurus Site" +name: "🦕 Docusaurus Site" on: workflow_dispatch: @@ -20,7 +20,7 @@ jobs: - name: Build Site working-directory: doc/docusaurus - run: nix develop --accept-flake-config --command bash -c 'yarn && yarn build' + run: nix develop --no-warn-dirty --accept-flake-config --command bash -c 'yarn && yarn build' - name: Deploy Site uses: JamesIves/github-pages-deploy-action@v4.6.1 diff --git a/.github/workflows/haddock-site.yml b/.github/workflows/haddock-site.yml index 316db579fc4..32dbb5981e0 100644 --- a/.github/workflows/haddock-site.yml +++ b/.github/workflows/haddock-site.yml @@ -3,7 +3,7 @@ # And optionally to: # https://intersectmbo.github.io/plutus/haddock/latest -name: "📜 Deploy Haddock Site" +name: "📜 Haddock Site" on: workflow_dispatch: @@ -48,7 +48,7 @@ jobs: - name: Build Site run: | - nix develop --accept-flake-config --command ./scripts/combined-haddock.sh _haddock all + nix develop --no-warn-dirty --accept-flake-config --command ./scripts/combined-haddock.sh _haddock all - name: Deploy Site uses: JamesIves/github-pages-deploy-action@v4.6.1 diff --git a/.github/workflows/longitudinal-benchmark.yml b/.github/workflows/longitudinal-benchmark.yml index 2768c3c34c3..f5b00e001a5 100644 --- a/.github/workflows/longitudinal-benchmark.yml +++ b/.github/workflows/longitudinal-benchmark.yml @@ -1,12 +1,13 @@ -# Longitudinal Benchmarks -# -# This workflow will run the benchmarks defined in the environment variable BENCHMARKS. -# It will collect and aggreate the benchmark output, format it and feed it to github-action-benchmark. +# This workflow runs the benchmarks defined in the environment variable BENCHMARKS. +# It will collect and aggreate the benchmark output, format it and feed it to the +# github-action-benchmark action. # -# The benchmark charts are live at https://input-output-hk.github.io/plutus/dev/bench -# The benchmark data is available at https://input-output-hk.github.io/plutus/dev/bench/data.js +# The benchmark charts are live at https://intersectmbo.github.io/plutus/dev/bench +# The benchmark data is available at https://intersectmbo.github.io/plutus/dev/bench/data.js +# +# This is a performance regression check that is run on every push master. -name: Longitudinal Benchmarks +name: "🩺 Longitudinal Benchmark" on: push: @@ -20,28 +21,26 @@ permissions: contents: write jobs: - longitudinal-benchmarks: - name: Performance regression check + run: + name: Run runs-on: [self-hosted, plutus-benchmark] steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@V27 - with: - nix_path: nixpkgs=channel:nixos-unstable + - name: Checkout + uses: actions/checkout@main - - name: Run benchmarks + - name: Run Benchmarks env: BENCHMARKS: "validation validation-decode nofib marlowe" run: nix develop --no-warn-dirty --accept-flake-config --command bash ./scripts/run-longitudinal-benchmarks.sh - # We need this otherwise the next step (Store benchmark result) will fail with: + # We need this otherwise the next step will fail with: # `pre-commit` not found. Did you forget to activate your virtualenv? # This is because github-action-benchmark will call git commit outside nix develop. - name: Disable Git Hooks run: git config core.hooksPath no-hooks - - name: Store benchmark result - uses: benchmark-action/github-action-benchmark@v1.20.3 + - name: Deploy Results + uses: benchmark-action/github-action-benchmark@main with: name: Plutus Benchmarks tool: 'customSmallerIsBetter' @@ -51,9 +50,10 @@ jobs: auto-push: true # Enable alert commit comment comment-on-alert: true - # Mention @IntersectMBO/plutus-core in the commit comment + # Mention @IntersectMBO/plutus-core in the commit comment so that the + # team is notified via GitHub. alert-comment-cc-users: '@IntersectMBO/plutus-core' - # Percentage value like "110%". # It is a ratio indicating how worse the current benchmark result is. - # For example, if we now get 110 ns/iter and previously got 100 ns/iter, it gets 110% worse. + # For example, if we now get 110 ns/iter and previously got 100 ns/iter, it got 10% worse. + # In this case we alert if it gets 5% worse. alert-threshold: '105%' diff --git a/.github/workflows/benchmark.yml b/.github/workflows/manual-benchmark.yml similarity index 85% rename from .github/workflows/benchmark.yml rename to .github/workflows/manual-benchmark.yml index e4999219043..101eb852029 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/manual-benchmark.yml @@ -1,12 +1,18 @@ -name: Benchmark +# This workflows checks for comments in PRs. If the comment has this format: +# /benchmark NAME +# Then this action will run the benchmark with the given NAME, first agains +# the current branch and then comparing the results against the master branch. + +name: "🚀 Manual Benchmark" + on: issue_comment: types: [created] jobs: - benchmark: + run: + name: Run runs-on: [self-hosted, plutus-benchmark] - permissions: pull-requests: write @@ -16,13 +22,13 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@main with: # We need at least one commit before master to compare against fetch-depth: 5 - - name: React with Rocket - uses: actions/github-script@v7 + - name: React With Rocket + uses: actions/github-script@main with: script: | github.rest.reactions.createForIssueComment({ @@ -34,7 +40,7 @@ jobs: - name: Extract Benchmark Name id: extract-benchmark - uses: actions/github-script@v7 + uses: actions/github-script@main with: script: | const regex = /^\/benchmark\s*(.*?)\s*$/; @@ -45,9 +51,9 @@ jobs: else core.setFailed(`Unable to extract benchmark name from ${comment}`); - - name: Extract Comment Branch + - name: Extract Branch Name id: extract-branch - uses: actions/github-script@v7 + uses: actions/github-script@main with: script: | async function isPullRequest() { @@ -90,8 +96,8 @@ jobs: core.setFailed(`Error: ${error}`); } - - name: Publish Link To Action Run - uses: actions/github-script@v7 + - name: Publish GH Action Link + uses: actions/github-script@main with: script: | async function getJobUrl() { @@ -105,7 +111,7 @@ jobs: body: `Click [here](${await getJobUrl()}) to check the status of your benchmark.` }); - - name: Run + - name: Run Benchmark run: | nix develop --no-warn-dirty --accept-flake-config --command bash ./scripts/ci-plutus-benchmark.sh env: @@ -115,7 +121,7 @@ jobs: - name: Publish Results - uses: actions/github-script@v7 + uses: actions/github-script@main with: script: | const fs = require("fs"); diff --git a/.github/workflows/metatheory-site.yml b/.github/workflows/metatheory-site.yml index ef2e6497076..33bde394477 100644 --- a/.github/workflows/metatheory-site.yml +++ b/.github/workflows/metatheory-site.yml @@ -1,10 +1,9 @@ -# This workflow publishes the Agda metatheory site to: -# https://intersectmbo.github.io/plutus/metatheory/$version -# Where $version should be a release version tag. -# Optionally the $version branch can also be deployed to: -# https://intersectmbo.github.io/plutus/metatheory/latest +# This workflow builds and publishes the metatheory site to: +# https://intersectmbo.github.io/plutus/metatheory/$version +# And optionally to: +# https://intersectmbo.github.io/plutus/metatheory/latest -name: "🔮 Deploy Metatheory Site" +name: "🔮 Metatheory Site" on: workflow_dispatch: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly-testsuite.yml similarity index 62% rename from .github/workflows/nightly.yml rename to .github/workflows/nightly-testsuite.yml index c92f268b490..483e1bd7f70 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly-testsuite.yml @@ -1,10 +1,12 @@ -name: Nightly Test Suite +# This workflow runs the nightly plutus-core-test and plutus-ir-test test suite. + +name: "🌘 Nightly Testsuite" on: schedule: - - cron: 0 0 * * * # daily at midnight + - cron: 0 0 * * * # Daily at midnight - workflow_dispatch: # or manually dispatch the job + workflow_dispatch: # Or manually dispatch the job inputs: hedgehog-tests: description: Numer of tests to run (--hedgehog-tests XXXXX) @@ -15,19 +17,20 @@ env: HEDGEHOG_TESTS: ${{ github.event.inputs.hedgehog-tests || 100000 }} jobs: - nightly-test-suite: - runs-on: [self-hosted, plutus-shared] + run: + name: Run + runs-on: [self-hosted, plutus-benchmark] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@main - - name: plutus-core-nightly + - name: Run Plutus Core Test run: | pushd plutus-core nix run --no-warn-dirty --accept-flake-config .#plutus-core-test -- --hedgehog-tests $HEDGEHOG_TESTS popd - - name: plutus-ir-nightly + - name: Run Plutus IR Test run: | pushd plutus-core nix run --no-warn-dirty --accept-flake-config .#plutus-ir-test -- --hedgehog-tests $HEDGEHOG_TESTS diff --git a/.github/workflows/plutus-tx-template.yml b/.github/workflows/plutus-tx-template.yml index d6bcfbf55eb..db89e9c3bb2 100644 --- a/.github/workflows/plutus-tx-template.yml +++ b/.github/workflows/plutus-tx-template.yml @@ -5,30 +5,29 @@ # Finally, it double-checks that everything still builds correctly using cabal # inside the devx shell. -name: Plutus Tx Template +name: "🏛️ PlutusTx Template" on: pull_request: jobs: - plutus-tx-template: + build: name: Build - runs-on: ubuntu-latest + runs-on: [ubuntu-latest] steps: - - - name: Checkout plutus-tx-template - uses: actions/checkout@v4.1.4 + - name: Checkout plutus-tx-template Repo + uses: actions/checkout@main with: repository: IntersectMBO/plutus-tx-template path: plutus-tx-template - - name: Checkout plutus - uses: actions/checkout@v4.1.4 + - name: Checkout plutus Repo + uses: actions/checkout@main with: path: plutus-tx-template/plutus - - name: Write cabal.project.local - uses: DamianReeves/write-file-action@v1.3 + - name: Overwrite cabal.project.local + uses: DamianReeves/write-file-action@master with: path: plutus-tx-template/cabal.project.local write-mode: overwrite @@ -50,7 +49,6 @@ jobs: - name: Build Project With Docker run: | cd plutus-tx-template - ls -la docker run \ -v ./.:/workspaces/plutus-tx-template \ -w /workspaces/plutus-tx-template \ diff --git a/.github/workflows/script-evaluation-test.yml b/.github/workflows/script-evaluation-test.yml deleted file mode 100644 index fac93ebaf7b..00000000000 --- a/.github/workflows/script-evaluation-test.yml +++ /dev/null @@ -1,49 +0,0 @@ -# A nightly job which downloads script evaluation dumps from S3 and runs a regression test. -name: Script Evaluation Test -on: - schedule: - - cron: 30 3 * * * # 3:30am every day - workflow_dispatch: - -concurrency: - group: script-evaluation-test - # We only want at most one evaluation test running at a time - cancel-in-progress: true - -jobs: - script-evaluation-test: - runs-on: [self-hosted, default] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Quick Install Nix - uses: cachix/install-nix-action@V27 - with: - extra_nix_config: | - experimental-features = nix-command flakes - accept-flake-config = true - - - name: Download and Unzip Dump Files - if: always() - # NOTE: the S3 location s3://plutus/mainnet-script-dump/ must match that in - # plutus-apps/.github/script-evaluation-dump.yml - run: | - export LOCAL_DIR="$HOME/mainnet-script-dump-downloaded" - nix develop --no-warn-dirty --accept-flake-config --command \ - bash ./scripts/s3-sync-unzip.sh s3://plutus/mainnet-script-dump-1-35-4/ \*.event.bz2 - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_DEFAULT_REGION: us-east-1 - AWS_ENDPOINT_URL: https://s3.devx.iog.io - - - name: Run - # Run the test cases sequentially. This ensures we don't need to simultaneously store - # multiple `ScriptEvaluationEvents`, which are large, in memory. Each test case - # contains many script evaluation events, and those are run in parallel based on - # the number of available processors. - run: | - export EVENT_DUMP_DIR="$HOME/mainnet-script-dump-downloaded" - nix run --no-warn-dirty --accept-flake-config .#evaluation-test -- --num-threads=1 diff --git a/.github/workflows/slack-message-broker.yml b/.github/workflows/slack-message-broker.yml deleted file mode 100644 index c28d2e1957d..00000000000 --- a/.github/workflows/slack-message-broker.yml +++ /dev/null @@ -1,47 +0,0 @@ -# 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. -# TODO turn this into a standalone GitHub action so that it can be used in other repositories. -name: Slack Message Broker -on: - workflow_run: - workflows: [Script Evaluation Test, Benchmark, Build and Deploy to Github Pages] - types: [completed, requested, in_progress] - -jobs: - slack-broker: - runs-on: [ubuntu-latest] - if: contains(fromJson('["cancelled", "failure"]'), github.event.workflow_job.status) - steps: - - name: Prepare Slack Message - uses: actions/github-script@v7 - 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 emojy = { failure: "❌", cancelled: "✋" }[status]; - const conclusion = "${{ github.event.workflow_job.conclusion }}"; - const action = "${{ github.event.action }}"; - const message = `${emojy} \`${name}\` *${action}* | *${status}* | *${conclusion}* 👉🏻 <${url}|view logs>`; - core.setOutput("message", message); - - - name: Notify Slack - uses: slackapi/slack-github-action@v1.26.0 - with: - channel-id: my-private-channel - payload: | - { - "text": "${{ steps.prepare-slack-message.outputs.message }}", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "${{ steps.prepare-slack-message.outputs.message }}" - } - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} diff --git a/.github/workflows/add-triage-label.yml b/.github/workflows/triage-label.yml similarity index 78% rename from .github/workflows/add-triage-label.yml rename to .github/workflows/triage-label.yml index d896fb0ec22..c4889db0b48 100644 --- a/.github/workflows/add-triage-label.yml +++ b/.github/workflows/triage-label.yml @@ -1,21 +1,21 @@ -# Whenever a new issue is opened, this workflow adds the "status: needs triage" -# label, unless the issue already has one of the "Internal" labels. +# Whenever a new issue is opened, this job adds the "status: needs triage" +# label, unless the issue already has one of the INTERNAL_LABELS. + +name: "🏷️ Triage Label" -name: Add Triage Label on: - issues: - types: - - reopened - - opened + pull_request: + types: [ opened, reopened ] jobs: - add-triage-label: - runs-on: ubuntu-latest + add: + name: Add + runs-on: [ubuntu-latest] permissions: issues: write steps: - - name: Run - uses: actions/github-script@v7 + - name: Add Label + uses: actions/github-script@main with: script: | const INTERNAL_LABELS = ["Internal", "status: triaged"]; @@ -51,7 +51,3 @@ jobs: core.setFailed(`Error: ${error}`); } - - - - \ No newline at end of file