Skip to content

Commit

Permalink
first attempt at building cargo-risczero from main
Browse files Browse the repository at this point in the history
  • Loading branch information
nategraf committed May 8, 2024
1 parent 2ca9f48 commit cfa4bcb
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 8 deletions.
35 changes: 35 additions & 0 deletions .github/actions/cargo-risczero-install/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: cargo risczero install
description: Install cargo risczero, build toolchains, and r0vm.

inputs:
ref:
description: 'Git reference to pull from risc0/risc0 and build'
required: true
type: string
toolchain-version:
description: 'Version of the RISC Zero toolchains to install'
required: true
features:
description: 'Comma separated list of feature flags to set when building cargo risczero'
required: false
default: 'default'
type: string

runs:
using: composite
steps:
- name: checkout risc0
uses: actions/checkout@v4
with:
repository: 'risc0/risc0'
token: ${{ secrets.GITHUB_TOKEN }}
path: 'tmp/risc0'
ref: ${{ inputs.ref }}
lfs: true
- name: install cargo-risczero
run: cargo install --path risc0/cargo-risczero --no-default-features --features "${{ input.features }}"
working-directory: tmp/risc0
- name: install toolchains
run: cargo risczero install
- name: cleanup
run: rm -rf tmp
21 changes: 13 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ permissions:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RISC0_TOOLCHAIN_VERSION: v2024-02-08.1
RISC0_CRATE_VERSION: "^0.21"
RISC0_MONOREPO_REF: "main"

jobs:
# see: https://github.com/orgs/community/discussions/26822
Expand Down Expand Up @@ -102,9 +102,10 @@ jobs:
- uses: risc0/risc0/.github/actions/sccache@main
with:
key: ${{ matrix.os }}-${{ matrix.feature }}
# TODO(victor) install cargo-risczero from main
- run: cargo install --force --locked cargo-risczero@$RISC0_CRATE_VERSION -F $FEATURE
- run: cargo risczero install --version $RISC0_TOOLCHAIN_VERSION
- uses: ./.github/actions/cargo-risczero-install
with:
ref: $RISC0_MONOREPO_REF
toolchain-version: $RISC0_TOOLCHAIN_VERSION
- uses: risc0/foundry-toolchain@2fe7e70b520f62368a0e3c464f997df07ede420f
with:
version: nightly-09fe3e041369a816365a020f715ad6f94dbce9f2
Expand Down Expand Up @@ -141,8 +142,10 @@ jobs:
- uses: risc0/risc0/.github/actions/sccache@main
with:
key: Linux-default
- run: cargo install --force --locked cargo-risczero@$RISC0_CRATE_VERSION
- run: cargo risczero install --version $RISC0_TOOLCHAIN_VERSION
- uses: ./.github/actions/cargo-risczero-install
with:
ref: $RISC0_MONOREPO_REF
toolchain-version: $RISC0_TOOLCHAIN_VERSION
- name: build erc20
run: cargo build --locked
working-directory: examples/erc20
Expand Down Expand Up @@ -172,8 +175,10 @@ jobs:
- uses: risc0/risc0/.github/actions/sccache@main
with:
key: macOS-default
- run: cargo install --force --locked cargo-risczero@$RISC0_CRATE_VERSION
- run: cargo risczero install --version $RISC0_TOOLCHAIN_VERSION
- uses: ./.github/actions/cargo-risczero-install
with:
ref: $RISC0_MONOREPO_REF
toolchain-version: $RISC0_TOOLCHAIN_VERSION
- run: cargo doc --locked --no-deps --workspace
# TODO(#18) debug forge doc and get this working
#- run: forge doc --root contracts
Expand Down

0 comments on commit cfa4bcb

Please sign in to comment.