Skip to content

Commit

Permalink
Add risc0-install action shared across workflows (#1379)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfldde authored Oct 25, 2024
1 parent db91e8f commit 8cd4668
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 78 deletions.
21 changes: 21 additions & 0 deletions .github/actions/install-risc0/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Install risc0'
description: 'Installs risc0 toolchain'

inputs:
github_token:
description: 'GitHub token for authentication'
required: true

runs:
using: "composite"
steps:
- name: Install cargo-risczero
uses: taiki-e/install-action@v2
with:
tool: [email protected]

- name: Install risc0-zkvm toolchain
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
run: cargo risczero install --version r0.1.79.0-2
50 changes: 15 additions & 35 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,10 @@ jobs:
uses: dtolnay/rust-toolchain@nightly
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-risczero
uses: taiki-e/install-action@v2
- name: Install risc0
uses: ./.github/actions/install-risc0
with:
tool: [email protected]
- name: Install risc0-zkvm toolchain
run: cargo risczero install --version r0.1.79.0-2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Build citrea
run: make build-release
env:
Expand Down Expand Up @@ -127,14 +123,10 @@ jobs:
components: rustfmt, clippy
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-risczero
uses: taiki-e/install-action@v2
- name: Install risc0
uses: ./.github/actions/install-risc0
with:
tool: [email protected]
- name: Install risc0-zkvm toolchain
run: cargo risczero install --version r0.1.79.0-2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Check TOML
uses: dprint/[email protected]
- name: Run lint
Expand Down Expand Up @@ -166,14 +158,10 @@ jobs:
override: true
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-risczero
uses: taiki-e/install-action@v2
- name: Install risc0
uses: ./.github/actions/install-risc0
with:
tool: [email protected]
- name: Install risc0-zkvm toolchain
run: cargo risczero install --version r0.1.79.0-2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Run cargo-udeps
env:
RUSTFLAGS: -A warnings
Expand Down Expand Up @@ -205,14 +193,10 @@ jobs:
uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@nextest
- uses: taiki-e/install-action@cargo-llvm-cov
- name: Install cargo-risczero
uses: taiki-e/install-action@v2
- name: Install risc0
uses: ./.github/actions/install-risc0
with:
tool: [email protected]
- name: Install risc0-zkvm toolchain
run: cargo risczero install --version r0.1.79.0-2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache ethereum-tests
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -373,14 +357,10 @@ jobs:
uses: dtolnay/[email protected]
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-risczero
uses: taiki-e/install-action@v2
- name: Install risc0
uses: ./.github/actions/install-risc0
with:
tool: [email protected]
- name: Install risc0-zkvm toolchain
run: cargo risczero install --version r0.1.79.0-2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
# `cargo-nextest` is much faster than standard `cargo test`.
- uses: taiki-e/install-action@nextest
- name: Cache ethereum-tests
Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/nightly_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,10 @@ jobs:
rustup install 1.79.0
rustup default 1.79.0
- name: Install Cargo Binstall
run: |
cargo install --version 1.7.0 cargo-binstall
- name: Install cargo-risczero
run: |
cargo binstall [email protected] --no-confirm
- name: Install risc0-zkvm toolchain
run: cargo risczero install --version r0.1.79.0-2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install risc0
uses: ./.github/actions/install-risc0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Build Project
env:
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,10 @@ jobs:
components: rustfmt, clippy
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-risczero
uses: taiki-e/install-action@v2
- name: Install risc0
uses: ./.github/actions/install-risc0
with:
tool: [email protected]
- name: Install risc0-zkvm toolchain
run: cargo risczero install --version r0.1.79.0-2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache ethereum-tests
uses: actions/cache@v3
with:
Expand Down
32 changes: 8 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,10 @@ jobs:
rustup install 1.79.0
rustup default 1.79.0
- name: Install Cargo Binstall
run: |
source $HOME/.cargo/env
cargo install --version 1.7.0 cargo-binstall
- name: Install cargo-risczero
run: |
cargo binstall [email protected] --no-confirm
- name: Install risc0-zkvm toolchain
run: cargo risczero install --version r0.1.79.0-2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install risc0
uses: ./.github/actions/install-risc0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Build Project
env:
Expand Down Expand Up @@ -79,17 +70,10 @@ jobs:
rustup install 1.79.0
rustup default 1.79.0
- name: Install Cargo Binstall
run: |
source $HOME/.cargo/env
cargo install --version 1.7.0 cargo-binstall
- name: Install cargo-risczero
run: |
cargo binstall [email protected] --no-confirm
- name: Install risc0-zkvm toolchain
run: cargo risczero install --version r0.1.79.0-2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install risc0
uses: ./.github/actions/install-risc0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Project
env:
REPR_GUEST_BUILD: 1
Expand Down

0 comments on commit 8cd4668

Please sign in to comment.