Skip to content

Commit

Permalink
Check if Certora Key is set in the repo for CI (#52)
Browse files Browse the repository at this point in the history
This PR adds a check to see if the `CERTORA_KEY` is set or not to run
the CI. If the key is not set, the Certora check will show as "Skipped"
instead of Success in the GitHub Actions.

This ensures that the repo can be upstreamed to Candide without any
immediate failure to the CI. It also ensures that it doesn't show the
impression of FV passing without verification.

P.S. I have disabled the ruleset which required all the FV tasks to be
successful so this could be included.
  • Loading branch information
remedcu authored Jul 1, 2024
1 parent 6b160b8 commit d0083e0
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/certora_recovery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,30 @@ on:
branches:
- main

env:
CERTORAKEY: ${{ secrets.CERTORA_KEY }}

jobs:
check-secret:
runs-on: ubuntu-latest
outputs:
certora-key-exists: ${{ steps.certora-key-check.outputs.defined }}
steps:
- name: Check for Certora Secret availability
id: certora-key-check
# perform secret check & put boolean result as an output
run: |
if [[ -n "${CERTORAKEY}" ]]; then
echo "defined=true" >> $GITHUB_OUTPUT;
echo "CERTORA_KEY exists"
else
echo "defined=false" >> $GITHUB_OUTPUT;
echo "CERTORA_KEY does not exist"
fi
verify:
needs: [check-secret]
if: needs.check-secret.outputs.certora-key-exists == 'true'
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -43,7 +65,4 @@ jobs:

- name: Verify rule ${{ matrix.rule }}
run: |
echo "Certora key length" ${#CERTORAKEY}
certoraRun certora/conf/${{ matrix.rule }}.conf --wait_for_results=all
env:
CERTORAKEY: ${{ secrets.CERTORA_KEY }}

0 comments on commit d0083e0

Please sign in to comment.