Skip to content

Commit

Permalink
ci: windows: build bitwuzla for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
elopez committed Jul 28, 2024
1 parent 6f27b4a commit df0d25f
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 2 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/bitwuzla-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
on:
workflow_call:

env:
BITWUZLA_VERSION: 0.5.0

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Cache Bitwuzla build
id: cache-bitwuzla
uses: actions/cache@v4
with:
path: bitwuzla/build/install
key: ${{ runner.os }}-bitwuzla-install-${{ env.BITWUZLA_VERSION }}

- name: Install Packages
if: steps.cache-bitwuzla.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install -y libgmp-dev ninja-build mingw-w64
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
- name: Setup Python Environment
if: steps.cache-bitwuzla.outputs.cache-hit != 'true'
run: |
python3 -m venv ~/.bitwuzla-venv
source ~/.bitwuzla-venv/bin/activate
python3 -m pip install meson pytest cython>=3.*
echo "$HOME/.bitwuzla-venv/bin/" >> $GITHUB_PATH
- name: Checkout
uses: actions/checkout@v4
if: steps.cache-bitwuzla.outputs.cache-hit != 'true'
with:
repository: bitwuzla/bitwuzla
ref: ${{ env.BITWUZLA_VERSION }}
path: bitwuzla
submodules: "recursive"

- name: Wrap
if: steps.cache-bitwuzla.outputs.cache-hit != 'true'
run: meson wrap install gtest
working-directory: bitwuzla

- name: Configure
if: steps.cache-bitwuzla.outputs.cache-hit != 'true'
run: ./configure.py --prefix=${{ github.workspace }}/bitwuzla/build/install --win64
working-directory: bitwuzla

- name: Build
if: steps.cache-bitwuzla.outputs.cache-hit != 'true'
run: ninja install
working-directory: bitwuzla/build

- name: Upload Bitwuzla binary
uses: actions/upload-artifact@v4
with:
name: bitwuzla-win64
path: bitwuzla/build/install
17 changes: 15 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
push:
branches:
main
dev-windows-tests-3

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -61,8 +61,13 @@ jobs:
- name: run ethereum tests
run: nix-shell --pure --command "cabal --active-repositories=:none run ethereum-tests"

build-windows-bitwuzla:
name: bitwuzla-build (win64 target)
uses: ./.github/workflows/bitwuzla-windows.yml

build-windows:
name: build (windows-latest)
needs: [build-windows-bitwuzla]
runs-on: windows-latest
defaults:
run:
Expand Down Expand Up @@ -177,8 +182,16 @@ jobs:
repository: foundry-rs/forge-std
path: forge-std

- name: download bitwuzla
uses: actions/download-artifact@v4
with:
name: bitwuzla-win64
path: bitwuzla-win64

- name: prepare test dependencies
run: |
# bitwuzla
echo BITWUZLA_PATH="$PWD/bitwuzla-win64/bin" >> "$GITHUB_ENV"
# evm
go install github.com/ethereum/go-ethereum/cmd/evm@latest
echo EVM_PATH="$(cygpath -u "$(go env GOPATH)/bin")" >> "$GITHUB_ENV"
Expand All @@ -200,7 +213,7 @@ jobs:
- name: run tests
run: |
export PATH="$EVM_PATH:$CVC5_PATH:$DAPP_SOLC_PATH:$HASKELL_PATHS:$PATH"
export PATH="$EVM_PATH:$CVC5_PATH:$BITWUZLA_PATH:$DAPP_SOLC_PATH:$HASKELL_PATHS:$PATH"
cabal run test
- name: run rpc tests
Expand Down

0 comments on commit df0d25f

Please sign in to comment.