From 56bf08576b7013161fad94dccb286347f25c8452 Mon Sep 17 00:00:00 2001 From: Yuriy Lazaryev Date: Thu, 20 Feb 2025 13:41:29 +0100 Subject: [PATCH] Evaluation workflow --- .github/workflows/evaluate.yml | 29 ++++++++++++++++++++++++++++ run-script-evaluations/add_srp.sh | 28 +++++++++++++++++++++++++++ run-script-evaluations/cabal.project | 9 --------- run-script-evaluations/tmp_repo | 1 + 4 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/evaluate.yml create mode 100755 run-script-evaluations/add_srp.sh create mode 160000 run-script-evaluations/tmp_repo diff --git a/.github/workflows/evaluate.yml b/.github/workflows/evaluate.yml new file mode 100644 index 0000000..c3af6cc --- /dev/null +++ b/.github/workflows/evaluate.yml @@ -0,0 +1,29 @@ +name: "Evaluate mainnet scripts" + +# on: +# schedule: +# - cron: "0 0 * * 5" # Run every Friday at midnight + +on: + pull_request: + +jobs: + build: + name: Build + runs-on: [plutus-script-evaluation-ci, self-hosted] + strategy: + fail-fast: false + steps: + - name: Checkout this Repo + uses: actions/checkout@main + with: + path: temp + + - name: Add plutus SRP to the cabal.project + id: update_cabal_project + run: add_srp.sh + + - name: Evaluate + run: | + nix develop --no-warn-dirty --accept-flake-config \ + --command bash -c 'cabal clean && cabal update && evaluate' diff --git a/run-script-evaluations/add_srp.sh b/run-script-evaluations/add_srp.sh new file mode 100755 index 0000000..ad7af90 --- /dev/null +++ b/run-script-evaluations/add_srp.sh @@ -0,0 +1,28 @@ +#! /usr/bin/env nix-shell +#! nix-shell -i bash --packages nix-prefetch-git + +REPO="IntersectMBO/plutus" +REPO_URL="https://github.com/$REPO" +PREFETCHED=$(nix-prefetch-git --quiet --url $REPO_URL --no-deepClone) +LAST_COMMIT=$(echo $PREFETCHED | jq -r .rev) +NIX_SHA=$(echo $PREFETCHED | jq -r .hash) + +# Create the new section to append +read -r -d '' NEW_SECTION << EOM +source-repository-package + type: git + location: $REPO_URL + tag: $LAST_COMMIT + --sha256: $NIX_SHA + subdir: + plutus-tx + plutus-core + plutus-ledger-api +EOM + +# Append to cabal.project +echo "$NEW_SECTION" >> cabal.project + +# Output the values for potential later use +echo "commit=$LAST_COMMIT" >> $GITHUB_OUTPUT +echo "sha256=$NIX_SHA" >> $GITHUB_OUTPUT diff --git a/run-script-evaluations/cabal.project b/run-script-evaluations/cabal.project index 03cd6f1..87dc714 100644 --- a/run-script-evaluations/cabal.project +++ b/run-script-evaluations/cabal.project @@ -23,12 +23,3 @@ packages: . package postgresql-libpq flags: +use-pkg-config -source-repository-package - type: git - location: https://github.com/intersectmbo/plutus - tag: 262adfd2c7fadb6d89a3c1835eb36b7f85bcf09d - --sha256: sha256-fWwRMARDf3KHIDvGKTInFGz/ISvgGLfF8r2MhK969y8= - subdir: - plutus-tx - plutus-core - plutus-ledger-api diff --git a/run-script-evaluations/tmp_repo b/run-script-evaluations/tmp_repo new file mode 160000 index 0000000..acb663d --- /dev/null +++ b/run-script-evaluations/tmp_repo @@ -0,0 +1 @@ +Subproject commit acb663d088268d29171d19314ed6d21087a34108