succinctlabs / sp1-project-template

Template for creating an SP1 project that can generate a proof of any RISC-V program and verify the proof on-chain.
MIT License
67 stars 24 forks source link

Add GitHub Workflow for SP1 Toolkit Installation and Program Build #12

Closed srdtrk closed 2 months ago

srdtrk commented 3 months ago

Implement a GitHub Actions workflow to install the SP1 toolkit and build the program using cargo-prove. This ensures that users do not break the program with their changes.

Workflow

name: Program

on: 
  workflow_dispatch:
  push:
    branches: [ main ]
  pull_request:

env:
  FOUNDRY_PROFILE: ci

jobs:
  check:
    strategy:
      fail-fast: true

    name: Build
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive

      - name: Install rust toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: nightly-2024-04-17
          override: true

      - name: Install SP1 toolchain
        run: |
          curl -L https://sp1.succinct.xyz | bash
          ~/.config/.sp1/bin/sp1up 
          ~/.config/.sp1/bin/cargo-prove prove --version

      - name: Build SP1 program
        run: |
          cd program
          ~/.config/.sp1/bin/cargo-prove prove build
ctian1 commented 2 months ago

Thanks for the suggestion, added in #24!