New Bonsai Foundry Template #321
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
RUST_BACKTRACE: "1" | |
RISC0_VERSION: 0.20.1 | |
RISC0_TOOLCHAIN_VERSION: test-release-2 | |
jobs: | |
integration: | |
name: local mock relay integration tests | |
runs-on: ubuntu-latest | |
steps: | |
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 | |
- name: checkout dummy commit (submodule bug workaround) | |
run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" | |
- name: clone repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install rust | |
uses: risc0/risc0/.github/actions/[email protected] | |
- name: Install Foundry | |
uses: risc0/foundry-toolchain@2fe7e70b520f62368a0e3c464f997df07ede420f | |
- name: Install cargo-install | |
uses: risc0/cargo-install@v1 | |
with: | |
crate: cargo-binstall | |
- name: Cargo binstall cargo-risczero | |
run: cargo binstall -y --force cargo-risczero@${{ env.RISC0_VERSION }} | |
- name: risczero toolchain install | |
run: cargo risczero install --version $RISC0_TOOLCHAIN_VERSION | |
- name: build rust guest | |
run: cargo build | |
- name: build solidity contracts | |
run: forge build | |
- name: run tests | |
run: cargo test | |
- name: run foundry tests with local exec | |
env: | |
RISC0_DEV_MODE: true | |
run: forge test -vvv | |
e2e: | |
name: end 2 end tests | |
runs-on: ubuntu-latest | |
steps: | |
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 | |
- name: checkout dummy commit (submodule bug workaround) | |
run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" | |
- name: clone repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install rust | |
uses: risc0/risc0/.github/actions/[email protected] | |
- name: Install Foundry | |
uses: risc0/foundry-toolchain@2fe7e70b520f62368a0e3c464f997df07ede420f | |
- name: Install cargo-install | |
uses: risc0/cargo-install@v1 | |
with: | |
crate: cargo-binstall | |
- name: Cargo binstall cargo-risczero | |
run: cargo binstall -y --force cargo-risczero@${{ env.RISC0_VERSION }} | |
- name: risczero toolchain install | |
run: cargo risczero install --version $RISC0_TOOLCHAIN_VERSION | |
- name: build rust guest | |
run: cargo build | |
- name: build solidity contracts | |
run: forge build | |
- name: run foundry tests with bonsai alpha proving | |
env: | |
BONSAI_API_URL: ${{ secrets.BONSAI_API_URL }} | |
BONSAI_API_KEY: ${{ secrets.BONSAI_API_KEY }} | |
RISC0_DEV_MODE: false | |
run: forge test -vvv |