Skip to content

Commit 2fe9263

Browse files
authored
add ci (#1)
* add ci * remove cargo test
1 parent d82debf commit 2fe9263

2 files changed

Lines changed: 116 additions & 0 deletions

File tree

.github/workflows/contracts.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Solidity Contracts
2+
on:
3+
push:
4+
branches: [main]
5+
paths:
6+
- "contracts/**"
7+
- ".github/workflows/contracts.yml"
8+
pull_request:
9+
branches: [main]
10+
paths:
11+
- "contracts/**"
12+
- ".github/workflows/contracts.yml"
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
solidity:
20+
name: build and test
21+
runs-on: ubuntu-latest
22+
defaults:
23+
run:
24+
working-directory: ./contracts
25+
steps:
26+
- uses: actions/checkout@v5
27+
28+
- name: Install Foundry
29+
uses: foundry-rs/foundry-toolchain@v1
30+
with:
31+
version: stable
32+
33+
- name: Show Forge version
34+
run: |
35+
forge --version
36+
id: version
37+
38+
- name: Run Forge fmt
39+
run: |
40+
forge fmt --check
41+
id: fmt
42+
43+
- name: Run Forge soldeer install
44+
run: |
45+
forge soldeer install
46+
id: soldeer
47+
48+
- name: Run Forge build
49+
run: |
50+
forge build --sizes
51+
id: build
52+
53+
- name: Run Forge tests
54+
run: |
55+
forge test -vvv
56+
id: test

.github/workflows/sp1.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: SP1 Programs
2+
on:
3+
push:
4+
branches: [main]
5+
paths:
6+
- "programs/**"
7+
- "scripts/**"
8+
- "primitives/**"
9+
- "Cargo.toml"
10+
- "Cargo.lock"
11+
- ".github/workflows/sp1.yml"
12+
pull_request:
13+
branches: [main]
14+
paths:
15+
- "programs/**"
16+
- "scripts/**"
17+
- "utils/**"
18+
- "Cargo.toml"
19+
- "Cargo.lock"
20+
- ".github/workflows/sp1.yml"
21+
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
rust:
28+
name: build and test
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v5
32+
33+
- name: Cache Build artifacts
34+
uses: Swatinem/rust-cache@v2.8.2
35+
with:
36+
cache-on-failure: true
37+
38+
- name: Install Rust toolchain
39+
uses: dtolnay/rust-toolchain@stable
40+
41+
- name: Install SP1
42+
run: |
43+
curl -L https://sp1up.succinct.xyz | bash
44+
echo "$HOME/.sp1/bin" >> $GITHUB_PATH
45+
- name: Install SP1 toolchain
46+
run: |
47+
sp1up
48+
cargo prove --version
49+
- name: Check formatting
50+
run: cargo fmt --all -- --check
51+
52+
- name: Generate ELFs
53+
run: cargo check
54+
55+
- name: Run clippy
56+
run: cargo clippy --all-targets
57+
58+
- name: Check generated files match
59+
run: |
60+
git diff --exit-code programs/

0 commit comments

Comments
 (0)