Skip to content

Commit daad609

Browse files
Set up Continuous Integration
1 parent 8688d33 commit daad609

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed

.github/workflows/ci.yml

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Sanity checks
2+
3+
on:
4+
merge_group:
5+
push:
6+
branches:
7+
- '**'
8+
9+
jobs:
10+
sanity:
11+
name: Sanity check
12+
timeout-minutes: 30
13+
runs-on: ubuntu-24.04
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: dtolnay/rust-toolchain@master
18+
with:
19+
components: rustfmt
20+
# TODO(Matthias): see whether we can keep this in sync with rust-toolchain.toml automatically?
21+
toolchain: nightly-2024-10-03
22+
- name: Cargo cache
23+
uses: actions/cache@v3
24+
with:
25+
# target directories gotten via
26+
# `find . -name target -type d -not -path '*/src/*' -printf '%P\n' | sort`
27+
# We need to exclude `./circ_blocks/src/target` because it just a source directory with an unfortunate name.
28+
path: |
29+
~/.cargo/bin/
30+
~/.cargo/registry/index/
31+
~/.cargo/registry/cache/
32+
~/.cargo/git/db/
33+
circ_blocks/circ_fields/target
34+
circ_blocks/circ_hc/target
35+
circ_blocks/circ_opt/target
36+
circ_blocks/circ_waksman/target
37+
circ_blocks/target
38+
circ_blocks/third_party/ZoKrates/zokrates_parser/target
39+
circ_blocks/third_party/ZoKrates/zokrates_pest_ast/target
40+
circ_blocks/third_party/ZoKrates/zokrates_stdlib/target
41+
ff/ff_derive/target
42+
ff/target
43+
spartan_parallel/target
44+
zok_tests/poseidon_gen/target
45+
key: sanity-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
46+
47+
- name: Run sanity check
48+
run: |
49+
set -euxo pipefail
50+
51+
for cargo_toml in $(git ls-files '**/Cargo.toml'); do
52+
(
53+
cd "$(dirname ${cargo_toml})"
54+
cargo fmt --check
55+
cargo check --all-targets
56+
)
57+
done
58+
59+
legacy-scripts:
60+
name: Run legacy scripts
61+
timeout-minutes: 30
62+
runs-on: ubuntu-24.04
63+
64+
steps:
65+
- uses: actions/checkout@v2
66+
- uses: dtolnay/rust-toolchain@master
67+
with:
68+
# TODO(Matthias): see whether we can keep this in sync with rust-toolchain.toml automatically?
69+
toolchain: nightly-2024-10-03
70+
- name: Cargo cache
71+
uses: actions/cache@v3
72+
with:
73+
# target directories gotten via
74+
# `find . -name target -type d -not -path '*/src/*' -printf '%P\n' | sort`
75+
# We need to exclude `./circ_blocks/src/target` because it just a source directory with an unfortunate name.
76+
path: |
77+
~/.cargo/bin/
78+
~/.cargo/registry/index/
79+
~/.cargo/registry/cache/
80+
~/.cargo/git/db/
81+
circ_blocks/circ_fields/target
82+
circ_blocks/circ_hc/target
83+
circ_blocks/circ_opt/target
84+
circ_blocks/circ_waksman/target
85+
circ_blocks/target
86+
circ_blocks/third_party/ZoKrates/zokrates_parser/target
87+
circ_blocks/third_party/ZoKrates/zokrates_pest_ast/target
88+
circ_blocks/third_party/ZoKrates/zokrates_stdlib/target
89+
ff/ff_derive/target
90+
ff/target
91+
spartan_parallel/target
92+
zok_tests/poseidon_gen/target
93+
key: scripts-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
94+
95+
- name: Run legacy scripts
96+
run: |
97+
set -euxo pipefail
98+
./setup.sh
99+
# TODO: fix, then enable it.
100+
# ./encode_ceno.sh

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,11 @@ Many flags are WIP. For temporary hacks, alter the code directly and recompile t
4242
#### Working with a different field
4343

4444
#### Verify circuit using `spartan_parallel` (only supported in Curve25519)
45+
46+
# Continuous Integration
47+
48+
At the moment we only have a [simple CI](.github/workflows/) that checks formatting and `cargo check` and runs [setup.sh](setup.sh) and [encode_ceno.sh](encode_ceno.sh).
49+
50+
TODO:
51+
- [ ] run tests in CI, too. (That means we need to fix our tests.)
52+
- [ ] reorganise the code, so that we only need a single `carge check` or `cargo test` instead of having to run that in a dozen different directories.

0 commit comments

Comments
 (0)