Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,26 @@
- run: nix build .#rustup-shim -L --accept-flake-config

test:
name: Test template dev shell
name: Test ${{ matrix.template }} template
runs-on: warp-ubuntu-latest-x64-16x
strategy:
fail-fast: false
matrix:
template:
- hello-world-async
- hello-world-blocking
steps:
- uses: actions/checkout@v6
- uses: cachix/install-nix-action@v31
- name: Replace sp1.nix URL with local path
run: |
sed -i 's|url = "github:argumentcomputer/sp1.nix"|url = "path:../.."|' flake.nix
nix flake update sp1 --accept-flake-config
working-directory: ${{ github.workspace }}/templates/hello-world
working-directory: ${{ github.workspace }}/templates/${{ matrix.template }}
- uses: Swatinem/rust-cache@v2
with:
workspaces: templates/${{ matrix.template }}
- run: nix develop --accept-flake-config --command bash -c "cd script && cargo run --release -- --prove"
working-directory: ${{ github.workspace }}/templates/hello-world
working-directory: ${{ github.workspace }}/templates/${{ matrix.template }}
env:
RUST_LOG: info

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nix
.direnv
**/.direnv
result
templates/**/flake.lock
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ Then enter a dev shell and run the proof:

```
cd my-project
nix develop
nix develop # or direnv allow
cd script && cargo run --release -- --prove
```

See the [template README](templates/hello-world/README.md) for more details on running proofs.
See the [template README](templates/hello-world-async/README.md) for more
details on running proofs.

## Packages

Expand All @@ -31,12 +32,12 @@ nix build .#sp1-home
nix build .#rustup-shim
```

| Package | Description |
|---------|-------------|
| `cargo-prove` | SP1 CLI (`cargo prove`) |
| `succinct-rust` | Succinct's patched Rust toolchain |
| `sp1-home` | Composed `~/.sp1` home directory |
| `rustup-shim` | Shim that routes `rustc` to `succinct-rust` when `RUSTUP_TOOLCHAIN=succinct` |
| Package | Description |
| --------------- | ---------------------------------------------------------------------------- |
| `cargo-prove` | SP1 CLI (`cargo prove`) |
| `succinct-rust` | Succinct's patched Rust toolchain |
| `sp1-home` | `~/.sp1` home directory |
| `rustup-shim` | Shim that routes `rustc` to `succinct-rust` when `RUSTUP_TOOLCHAIN=succinct` |

## Dev Shell

Expand Down
4 changes: 3 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@
cargo-prove
];
shellHook = ''
if [ ! -e "$HOME/.sp1" ]; then
if [ ! -e "$HOME/.sp1" ] && [ ! -L "$HOME/.sp1" ]; then
ln -s ${sp1-home} "$HOME/.sp1"
elif [ -L "$HOME/.sp1" ]; then
ln -snf ${sp1-home} "$HOME/.sp1"
elif [ ! -L "$HOME/.sp1" ]; then
echo "Warning: $HOME/.sp1 exists and is not a symlink. SP1 toolchain may not work correctly."
fi
Expand Down
5 changes: 5 additions & 0 deletions garnix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
builds:
exclude:
- "packages.*.build-image"
- "packages.*.run-sp1"
- "packages.*.sp1-shell"
8 changes: 6 additions & 2 deletions templates/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
rec {
hello-world = {
path = ./hello-world;
description = "Hello World";
path = ./hello-world-async;
description = "Hello World (Async)";
};
hello-world-blocking = {
path = ./hello-world-blocking;
description = "Hello World (Blocking)";
};
default = hello-world;
}
41 changes: 41 additions & 0 deletions templates/hello-world-async/.github/workflows/foundry-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Foundry Test

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


jobs:
check:
strategy:
fail-fast: true

name: Foundry project
runs-on:
- runs-on
- runner=1cpu-linux-x64
- run-id=${{ github.run_id }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run Forge build
run: |
cd contracts
forge --version
forge build --sizes
id: build

- name: Run Forge tests
run: |
cd contracts
forge test -vvv
id: test
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,17 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.85.0
toolchain: 1.93.0

- name: "Install protoc"
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler

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

- name: Build SP1 program
Expand Down
Loading
Loading