Skip to content

Commit b167241

Browse files
authored
upload examples (#1)
* upload examples * fix ci
1 parent e7a325f commit b167241

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+30130
-0
lines changed

.github/workflows/ci.yml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: arm-risc0 CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUST_BACKTRACE: 1
12+
RISC0_TOOLCHAIN_VERSION: 3.0.3
13+
14+
jobs:
15+
fmt:
16+
name: Format
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout sources
20+
uses: actions/checkout@v4
21+
22+
- name: Install Rust toolchain
23+
uses: dtolnay/rust-toolchain@master
24+
with:
25+
toolchain: "1.89"
26+
components: rustfmt
27+
28+
- name: Check formatting (main workspace)
29+
run: cargo fmt --all -- --check
30+
31+
- name: Check formatting (example_circuits workspace)
32+
run: cargo fmt --all -- --check
33+
working-directory: example_circuits
34+
35+
clippy:
36+
name: Clippy
37+
runs-on: macos-latest
38+
steps:
39+
- name: Checkout sources
40+
uses: actions/checkout@v4
41+
42+
- name: Install Rust toolchain
43+
uses: dtolnay/rust-toolchain@master
44+
with:
45+
toolchain: "1.89"
46+
components: clippy
47+
48+
- name: Setup Rust cache
49+
uses: Swatinem/rust-cache@v2
50+
with:
51+
workspaces: |
52+
.
53+
54+
- name: Run clippy (main workspace)
55+
run: cargo clippy --workspace --all-targets -- -D warnings
56+
57+
build:
58+
name: Build
59+
strategy:
60+
matrix:
61+
os: [macos-latest]
62+
rust: ["1.89"]
63+
runs-on: ${{ matrix.os }}
64+
steps:
65+
- name: Checkout sources
66+
uses: actions/checkout@v4
67+
68+
- name: Install Rust toolchain
69+
uses: dtolnay/rust-toolchain@master
70+
with:
71+
toolchain: ${{ matrix.rust }}
72+
targets: wasm32-unknown-unknown
73+
74+
- name: Setup Rust cache
75+
uses: Swatinem/rust-cache@v2
76+
with:
77+
workspaces: |
78+
.
79+
example_circuits
80+
81+
# - name: Install RISC0 toolchain
82+
# run: |
83+
# curl -L https://risczero.com/install | bash
84+
# $HOME/.risc0/bin/rzup install cargo-risczero $RISC0_TOOLCHAIN_VERSION
85+
# $HOME/.risc0/bin/rzup install r0vm $RISC0_TOOLCHAIN_VERSION
86+
87+
- name: Build main workspace
88+
run: cargo build --workspace --all-targets
89+
90+
## Skip building example_circuits workspace for now due to limited risc0-toolchain download requests
91+
# - name: Build example_circuits workspace
92+
# run: cargo build --workspace --all-targets
93+
# working-directory: example_circuits
94+
95+
test:
96+
name: Test
97+
strategy:
98+
matrix:
99+
# os: [ubuntu-latest, macos-latest]
100+
os: [macos-latest]
101+
rust: ["1.89"]
102+
runs-on: ${{ matrix.os }}
103+
env:
104+
RISC0_DEV_MODE: 1 # Use dev mode for faster testing
105+
steps:
106+
- name: Checkout sources
107+
uses: actions/checkout@v4
108+
109+
- name: Install Rust toolchain
110+
uses: dtolnay/rust-toolchain@master
111+
with:
112+
toolchain: ${{ matrix.rust }}
113+
targets: wasm32-unknown-unknown
114+
115+
- name: Setup Rust cache
116+
uses: Swatinem/rust-cache@v2
117+
with:
118+
workspaces: |
119+
.
120+
121+
- name: Run tests (main workspace)
122+
run: cargo test --workspace
123+
124+
test-release:
125+
name: Test Release
126+
runs-on: macos-latest
127+
env:
128+
RISC0_DEV_MODE: 1 # Use dev mode for faster testing
129+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
130+
steps:
131+
- name: Checkout sources
132+
uses: actions/checkout@v4
133+
134+
- name: Setup Rust cache
135+
uses: Swatinem/rust-cache@v2
136+
with:
137+
workspaces: |
138+
.
139+
140+
- name: Run release tests (main workspace)
141+
run: cargo test --workspace --release
142+
timeout-minutes: 60

0 commit comments

Comments
 (0)