Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 61 additions & 6 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,77 @@
name: Setup
description: Common environment setup
inputs:
withNpm:
description: Whether to set up Node.js and npm
required: false
default: 'true'
withFoundry:
description: Whether to set up Foundry
required: false
default: 'true'
withJava:
description: Whether to set up Java
required: false
default: 'false'
withPython:
description: Whether to set up Python
required: false
default: 'false'
withSolc:
description: Whether to set up solc
required: false
default: 'false'

runs:
using: composite
steps:
- uses: actions/setup-node@v6
# Node & npm setup
- name: Install Node.js (24.x)
if: ${{ inputs.withNpm == 'true' }}
uses: actions/setup-node@v6
with:
node-version: 24.x
- uses: actions/cache@v5
- name: Try fetch node modules from cache
id: cache
if: ${{ inputs.withNpm == 'true' }}
uses: actions/cache@v5
with:
path: '**/node_modules'
key: npm-v3-${{ hashFiles('**/package-lock.json') }}
key: npm-24.x-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
if: ${{ inputs.withNpm == 'true' && steps.cache.outputs.cache-hit != 'true' }}
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
- name: Install Foundry
run: npm ci
# Foundry setup
- name: Install Foundry (stable)
if: ${{ inputs.withFoundry == 'true' }}
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
# Java setup
- name: Install java 21
if: ${{ inputs.withJava == 'true' }}
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
# Python setup
- name: Install python (3.13)
if: ${{ inputs.withPython == 'true' }}
uses: actions/setup-python@v6
with:
python-version: 3.13
cache: 'pip'
cache-dependency-path: 'fv-requirements.txt'
- name: Install python packages
if: ${{ inputs.withPython == 'true' }}
shell: bash
run: pip install -r fv-requirements.txt
# Solc setup
- name: Install solc (0.8.27)
if: ${{ inputs.withSolc == 'true' }}
shell: bash
run: |
wget -q https://github.com/ethereum/solidity/releases/download/v0.8.27/solc-static-linux
chmod +x solc-static-linux
sudo mv solc-static-linux /usr/local/bin/solc
39 changes: 6 additions & 33 deletions .github/workflows/formal-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ on:
- labeled
workflow_dispatch: {}

env:
PIP_VERSION: '3.11'
JAVA_VERSION: '11'
SOLC_VERSION: '0.8.27'

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
Expand All @@ -26,13 +21,15 @@ jobs:

verify:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'formal-verification')
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'formal-verification') || contains(github.event.pull_request.labels.*.name, 'formal-verification-force-all')
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up environment
uses: ./.github/actions/setup
with:
withJava: 'true'
withPython: 'true'
withSolc: 'true'
- name: identify specs that need to be run
id: arguments
run: |
Expand All @@ -43,24 +40,6 @@ jobs:
RESULT='--all'
fi
echo "result=$RESULT" >> "$GITHUB_OUTPUT"
- name: Install python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PIP_VERSION }}
cache: 'pip'
cache-dependency-path: 'fv-requirements.txt'
- name: Install python packages
run: pip install -r fv-requirements.txt
- name: Install java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}
- name: Install solc
run: |
wget https://github.com/ethereum/solidity/releases/download/v${{ env.SOLC_VERSION }}/solc-static-linux
sudo mv solc-static-linux /usr/local/bin/solc
chmod +x /usr/local/bin/solc
- name: Verify specification
run: |
make -C fv apply
Expand All @@ -74,14 +53,8 @@ jobs:
- uses: actions/checkout@v6
- name: Set up environment
uses: ./.github/actions/setup
- name: Install python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PIP_VERSION }}
cache: 'pip'
cache-dependency-path: 'fv-requirements.txt'
- name: Install python packages
run: pip install -r fv-requirements.txt
withPython: 'true'
- name: Run Halmos
run: halmos --match-test '^symbolic|^testSymbolic' -vv
env:
Expand Down
Loading