First version of the CLI #8
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: CI/CD | |
on: | |
push: | |
branches: | |
- "main" | |
tags: | |
- "v*" | |
pull_request: | |
branches: | |
- "*" | |
env: | |
CARGO_TERM_COLOR: always | |
STONE_SDK_VERSION: v0.3.0 | |
STONE_INSTALL_DIR: ./dependencies/stone | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: 1.74 | |
override: true | |
components: rustfmt, clippy | |
- name: Set up cargo cache | |
uses: actions/cache@v3 | |
continue-on-error: false | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-cargo- | |
- name: Set Stone SDK version in context | |
id: set-env-sdk-version | |
run: | | |
echo "STONE_SDK_VERSION=${STONE_SDK_VERSION}" >> $GITHUB_ENV | |
echo "STONE_INSTALL_DIR=${STONE_INSTALL_DIR}" >> $GITHUB_ENV | |
- name: Cache Stone prover and verifier | |
id: cache-stone | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.STONE_INSTALL_DIR }} | |
key: stone-${{ runner.os }}-${{ env.STONE_SDK_VERSION }} | |
- name: Download Stone | |
if: steps.cache-stone.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p "${STONE_INSTALL_DIR}" | |
wget https://github.com/Moonsong-Labs/stone-prover-sdk/releases/download/${STONE_SDK_VERSION}/cpu_air_prover -O "${STONE_INSTALL_DIR}/cpu_air_prover" | |
wget https://github.com/Moonsong-Labs/stone-prover-sdk/releases/download/${STONE_SDK_VERSION}/cpu_air_verifier -O "${STONE_INSTALL_DIR}/cpu_air_verifier" | |
- name: Set Stone in PATH | |
run: | | |
echo "$(readlink -f ${STONE_INSTALL_DIR})" | |
echo "$(readlink -f ${STONE_INSTALL_DIR})" >> $GITHUB_PATH | |
exit 1 | |
- name: Lint with Clippy | |
run: cargo clippy -- -D warnings | |
- name: Build | |
run: cargo build --release --verbose | |
- name: Run tests | |
run: cargo test --verbose | |
- name: Upload release artifacts | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
target/release/stone-prover-cli |