From d7b98c47b8989b0d66a1a117983500e29a546e9d Mon Sep 17 00:00:00 2001 From: Britt Cyr Date: Tue, 26 Nov 2024 12:38:21 -0500 Subject: [PATCH] Github action for certora (#297) * Move to home dir * logging * github path * stdout * assert no errors --- .github/workflows/ci-certora.yml | 12 +++++++++++- programs/manifest/verify-manifest.py | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-certora.yml b/.github/workflows/ci-certora.yml index 425bfd003..3c9225edb 100644 --- a/.github/workflows/ci-certora.yml +++ b/.github/workflows/ci-certora.yml @@ -25,14 +25,24 @@ jobs: run: | sh -c "$(curl -sSfL https://release.solana.com/v${{ env.SOLANA_VERSION }}/install)" export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH" + echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH - name: Install certora platform tools run: | mkdir $HOME/platform-tools-certora - wget https://github.com/Certora/certora-solana-platform-tools/releases/download/linux-x86_64-ubuntu-20.04-10-22-2024/platform-tools-linux-x86_64.tar.bz2 cd $HOME + wget https://github.com/Certora/certora-solana-platform-tools/releases/download/linux-x86_64-ubuntu-20.04-10-22-2024/platform-tools-linux-x86_64.tar.bz2 tar -xvjf platform-tools-linux-x86_64.tar.bz2 -C $HOME/platform-tools-certora export PLATFORM_TOOLS_DIR=$HOME/.cache/solana/v1.41 + echo "Moving to active releases" + ls + cd $HOME/.local/share/solana/install/active_release/bin/sdk/sbf + echo "Inside active releases" + ls + source env.sh + echo "Moving to cache" + cd $HOME/.cache/solana/v1.41 + ls mv $PLATFORM_TOOLS_DIR/platform-tools $PLATFORM_TOOLS_DIR/platform-tools.backup ln -sf $HOME/platform-tools-certora $PLATFORM_TOOLS_DIR/platform-tools diff --git a/programs/manifest/verify-manifest.py b/programs/manifest/verify-manifest.py index 568003d85..07ea6fc7a 100755 --- a/programs/manifest/verify-manifest.py +++ b/programs/manifest/verify-manifest.py @@ -25,7 +25,7 @@ def from_string(result: str) -> 'VerificationResult': @staticmethod def from_command_result(command_result: subprocess.CompletedProcess[str]) -> 'VerificationResult': if command_result.returncode == 0: - assert "|Not violated" in command_result.stdout, "The verification terminated successfully, but cannot find the '|Not violated' substring in stdout" + assert ("|Not violated" in command_result.stdout or "No errors found by Prover!" in command_result.stdout), ("The verification terminated successfully, but cannot find the '|Not violated' substring in stdout" + str(command_result.stdout)) return VerificationResult.Verified elif "|Violated" in command_result.stdout: # If the return code is not zero, and in the stdout we find `|Violated`,