Skip to content

Commit 4e43edc

Browse files
committed
add ci and clippy pass
1 parent 289d381 commit 4e43edc

File tree

8 files changed

+129
-18
lines changed

8 files changed

+129
-18
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "cargo"
4+
directories: ["/crates"]
5+
schedule:
6+
interval: "weekly"

.github/workflows/lints.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Lints
2+
3+
on:
4+
merge_group:
5+
pull_request:
6+
types: [synchronize, opened, reopened, ready_for_review]
7+
push:
8+
branches:
9+
- master
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
13+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
14+
15+
jobs:
16+
lints:
17+
name: Various lints
18+
timeout-minutes: 30
19+
runs-on: ubuntu-24.04
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: dtolnay/rust-toolchain@master
24+
with:
25+
components: rustfmt, clippy
26+
targets: riscv32im-unknown-none-elf
27+
# TODO: figure out way to keep this in sync with rust-toolchain.toml automatically
28+
toolchain: nightly-2025-03-25
29+
- name: Cargo cache
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
~/.cargo/bin/
34+
~/.cargo/registry/index/
35+
~/.cargo/registry/cache/
36+
~/.cargo/git/db/
37+
target/
38+
ceno_rt/target/
39+
examples/target/
40+
key: lint-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
41+
restore-keys: lint-${{ runner.os }}-cargo-
42+
43+
- name: Install cargo make
44+
run: |
45+
cargo make --version || cargo install cargo-make
46+
47+
- name: Check code format
48+
run: cargo fmt --all --check
49+
50+
- name: Run clippy
51+
env:
52+
RUSTFLAGS: "-Dwarnings"
53+
run: |
54+
cargo check --workspace --all-targets
55+
# We have a lot of code under #[cfg(not(debug_assertions))] and similar,
56+
# so we need to run cargo check in release mode, too:
57+
cargo check --workspace --all-targets --release
58+
cargo make clippy
59+
# Same for clippy:
60+
cargo clippy --workspace --all-targets --release
61+
62+
- name: Install taplo
63+
run: taplo --version || cargo install taplo-cli
64+
- name: Run taplo
65+
run: taplo fmt --check --diff

.github/workflows/tests.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Tests
2+
3+
on:
4+
merge_group:
5+
pull_request:
6+
types: [ synchronize, opened, reopened, ready_for_review ]
7+
push:
8+
branches:
9+
- master
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
13+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
14+
15+
jobs:
16+
tests:
17+
name: Run Tests
18+
timeout-minutes: 30
19+
runs-on: ubuntu-24.04
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: dtolnay/rust-toolchain@master
24+
with:
25+
targets: riscv32im-unknown-none-elf
26+
# TODO: figure out way to keep this in sync with rust-toolchain.toml automatically
27+
toolchain: nightly-2025-03-25
28+
- name: Cargo cache
29+
uses: actions/cache@v4
30+
with:
31+
path: |
32+
~/.cargo/bin/
33+
~/.cargo/registry/index/
34+
~/.cargo/registry/cache/
35+
~/.cargo/git/db/
36+
target/
37+
ceno_rt/target/
38+
examples/target/
39+
key: tests-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
40+
restore-keys: tests-${{ runner.os }}-cargo-
41+
42+
- name: Install cargo make
43+
run: |
44+
cargo make --version || cargo install cargo-make
45+
- name: run test
46+
run: cargo make tests

Cargo.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ members = [
99
"crates/witness",
1010
"crates/p3",
1111
"crates/ff_ext",
12-
"crates/whir"
12+
"crates/whir",
1313
]
1414
resolver = "2"
1515

@@ -60,10 +60,8 @@ rand_core = "0.6"
6060
rayon = "1.10"
6161
serde = { version = "1.0", features = ["derive", "rc"] }
6262
serde_json = "1.0"
63-
thiserror = "1" # do we need this?
64-
tracing = { version = "0.1", features = [
65-
"attributes",
66-
] }
63+
thiserror = "1" # do we need this?
64+
tracing = { version = "0.1", features = ["attributes"] }
6765
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
6866

6967
[profile.dev]

Makefile.toml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ env = { RUST_MIN_STACK = "33554432" }
1616
workspace = false
1717

1818
[tasks.clippy]
19-
args = [
20-
"clippy",
21-
"--workspace",
22-
"--all-targets",
23-
"--",
24-
"-D",
25-
"warnings",
26-
]
19+
args = ["clippy", "--workspace", "--all-targets", "--", "-D", "warnings"]
2720
command = "cargo"
2821
workspace = false
29-

clippy.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# TODO(Matthias): review and see which exception we can remove over time.
2+
# Eg removing syn is blocked by ark-ff-asm cutting a new release
3+
# (https://github.com/arkworks-rs/algebra/issues/813) amongst other things.
4+
allowed-duplicate-crates = ["regex-automata", "regex-syntax"]

crates/sumcheck/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ version.workspace = true
1313
either.workspace = true
1414
ff_ext.workspace = true
1515
itertools.workspace = true
16-
multilinear_extensions = { path = "../multilinear_extensions", features = ["parallel"] }
16+
multilinear_extensions = { path = "../multilinear_extensions", features = [
17+
"parallel",
18+
] }
1719
p3.workspace = true
1820
rayon.workspace = true
1921
serde.workspace = true

crates/whir/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ nightly-features = [
4242
"transcript/nightly-features",
4343
"witness/nightly-features",
4444
]
45-
parallel = [
46-
"dep:rayon",
47-
]
45+
parallel = ["dep:rayon"]
4846
print-trace = ["tracing/log"]
4947
rayon = ["dep:rayon"]

0 commit comments

Comments
 (0)