From f08f8c5323e2054e56b70e55ed8c06709c85ef4d Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Mon, 29 May 2023 14:39:03 +0200 Subject: [PATCH] Enable `create_script_context` in CI --- .github/regression.sh | 34 +++++++++++++++++++++++++++++----- .github/source_plutus_apps.sh | 25 +++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 .github/source_plutus_apps.sh diff --git a/.github/regression.sh b/.github/regression.sh index 120865299..f5ca0c14e 100755 --- a/.github/regression.sh +++ b/.github/regression.sh @@ -23,11 +23,35 @@ mkdir -p "$WORKDIR" export TMPDIR="$WORKDIR/tmp" mkdir -p "$TMPDIR" -if [ "${CI_ENABLE_DBSYNC:-"false"}" != "false" ]; then - # setup dbsync - # shellcheck disable=SC1090,SC1091 - . .github/source_dbsync.sh -fi +# setup dbsync (disabled by default) +case "${CI_ENABLE_DBSYNC:-"false"}" in + "true" | 1) + # shellcheck disable=SC1090,SC1091 + . .github/source_dbsync.sh + ;; + "false" | 0) + ;; + *) + echo "Unknown value for CI_ENABLE_DBSYNC: ${CI_ENABLE_DBSYNC}" >&2 + exit 1 + ;; +esac + +# setup plutus-apps (enabled by default) +# The "plutus-apps" repo is needed for the `create-script-context` tool, which is used by the +# Plutus tests that are testing script context. +case "${CI_ENABLE_PLUTUS_APPS:-"true"}" in + "true" | 1) + # shellcheck disable=SC1090,SC1091 + . .github/source_plutus_apps.sh + ;; + "false" | 0) + ;; + *) + echo "Unknown value for CI_ENABLE_PLUTUS: ${CI_ENABLE_PLUTUS}" >&2 + exit 1 + ;; +esac if [ "${CI_TOPOLOGY:-""}" = "p2p" ]; then export ENABLE_P2P="true" diff --git a/.github/source_plutus_apps.sh b/.github/source_plutus_apps.sh new file mode 100644 index 000000000..33508ff22 --- /dev/null +++ b/.github/source_plutus_apps.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +echo "::group::plutus-apps setup" + +pushd "$WORKDIR" || exit 1 + +# Clone plutus-apps if needed +if [ ! -e plutus-apps ]; then + git clone --depth 1 --recurse-submodules --shallow-submodules https://github.com/input-output-hk/plutus-apps.git +fi + +pushd plutus-apps || exit 1 +git pull origin main +git rev-parse HEAD + +# Build `create-script-context` +nix build --accept-flake-config .#create-script-context -o create-script-context + +# Add `create-script-context` to PATH +PATH="$(readlink -m create-script-context/bin)":"$PATH" +export PATH + +pushd "$REPODIR" || exit 1 + +echo "::endgroup::"