ark-r1cs-std/.github/workflows/ci.yml
.github/workflows/ci.ymlRaw
1name: CI
2on:
3 pull_request:
4 push:
5 branches:
6 - master
7env:
8 RUST_BACKTRACE: 1
9
10jobs:
11 style:
12 name: Check Style
13 runs-on: ubuntu-latest
14 steps:
15
16 - name: Checkout
17 uses: actions/checkout@v1
18 - name: Install Rust
19 uses: actions-rs/toolchain@v1
20 with:
21 profile: minimal
22 toolchain: stable
23 override: true
24 components: rustfmt
25
26 - name: cargo fmt --check
27 uses: actions-rs/cargo@v1
28 with:
29 command: fmt
30 args: --all -- --check
31
32 test:
33 name: Test
34 runs-on: ubuntu-latest
35 env:
36 RUSTFLAGS: -Dwarnings --cfg ci
37 strategy:
38 matrix:
39 rust:
40 - stable
41 - nightly
42 steps:
43 - name: Checkout
44 uses: actions/checkout@v2
45
46 - name: Install Rust (${{ matrix.rust }})
47 uses: actions-rs/toolchain@v1
48 with:
49 profile: minimal
50 toolchain: ${{ matrix.rust }}
51 override: true
52
53 - uses: actions/cache@v2
54 with:
55 path: |
56 ~/.cargo/registry
57 ~/.cargo/git
58 target
59 key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
60
61 - name: Check examples
62 uses: actions-rs/cargo@v1
63 with:
64 command: check
65 args: --examples --all
66
67 - name: Check examples with all features on stable
68 uses: actions-rs/cargo@v1
69 with:
70 command: check
71 args: --examples --all-features --all
72 if: matrix.rust == 'stable'
73
74 - name: Check benchmarks on nightly
75 uses: actions-rs/cargo@v1
76 with:
77 command: check
78 args: --all-features --examples --all --benches
79 if: matrix.rust == 'nightly'
80
81 - name: Test
82 uses: actions-rs/cargo@v1
83 with:
84 command: test
85 args: "--all \
86 --all-features \
87 --exclude cp-benches "
88
89 docs:
90 name: Check Documentation
91 runs-on: ubuntu-latest
92 steps:
93
94 - name: Checkout
95 uses: actions/checkout@v1
96 - name: Install Rust
97 uses: actions-rs/toolchain@v1
98 with:
99 profile: minimal
100 toolchain: stable
101 override: true
102 components: rustfmt
103
104 - name: cargo doc --all --no-deps --document-private-items --all-features
105 uses: actions-rs/cargo@v1
106 with:
107 command: doc
108 args: --all --no-deps --document-private-items --all-features
109
110 check_no_std:
111 name: Check no_std
112 runs-on: ubuntu-latest
113 steps:
114 - name: Checkout
115 uses: actions/checkout@v2
116
117 - name: Install Rust (${{ matrix.rust }})
118 uses: actions-rs/toolchain@v1
119 with:
120 toolchain: stable
121 target: thumbv6m-none-eabi
122 override: true
123
124 - name: Install Rust ARM64 (${{ matrix.rust }})
125 uses: actions-rs/toolchain@v1
126 with:
127 toolchain: stable
128 target: aarch64-unknown-none
129 override: true
130
131 - uses: actions/cache@v2
132 with:
133 path: |
134 ~/.cargo/registry
135 ~/.cargo/git
136 target
137 key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
138
139 - name: r1cs-std
140 run: |
141 cargo build --no-default-features --target aarch64-unknown-none
142 cargo check --examples --no-default-features --target aarch64-unknown-none
143
144 test_against_curves:
145 name: Test against curves
146 runs-on: ubuntu-latest
147 env:
148 RUSTFLAGS: -Dwarnings
149 strategy:
150 matrix:
151 curve:
152 - bls12_377
153 - pallas
154 - vesta
155 - mnt4_298
156 - mnt6_298
157 - mnt6_753
158 - ed_on_bls12_381
159 steps:
160 - name: Checkout curves
161 uses: actions/checkout@v2
162 with:
163 repository: arkworks-rs/curves
164
165 - name: Checkout r1cs-std
166 uses: actions/checkout@v2
167 with:
168 path: r1cs-std
169
170 - name: Install Rust
171 uses: actions-rs/toolchain@v1
172 with:
173 profile: minimal
174 toolchain: stable
175 override: true
176
177 - name: Patch cargo.toml
178 run: |
179 if grep -q "\[patch.crates-io\]" Cargo.toml ; then
180 MATCH=$(awk '/\[patch.crates-io\]/{ print NR; exit }' Cargo.toml);
181 sed -i "$MATCH,\$d" Cargo.toml
182 fi
183 {
184 echo "[patch.crates-io]"
185 echo "ark-std = { git = 'https://github.com/arkworks-rs/std' }"
186 echo "ark-ec = { git = 'https://github.com/arkworks-rs/algebra' }"
187 echo "ark-ff = { git = 'https://github.com/arkworks-rs/algebra' }"
188 echo "ark-poly = { git = 'https://github.com/arkworks-rs/algebra' }"
189 echo "ark-relations = { git = 'https://github.com/arkworks-rs/snark' }"
190 echo "ark-serialize = { git = 'https://github.com/arkworks-rs/algebra' }"
191 echo "ark-algebra-bench-templates = { git = 'https://github.com/arkworks-rs/algebra' }"
192 echo "ark-algebra-test-templates = { git = 'https://github.com/arkworks-rs/algebra' }"
193 echo "ark-r1cs-std = { path = 'r1cs-std' }"
194 } >> Cargo.toml
195
196 - name: Test on ${{ matrix.curve }}
197 run: "cd ${{ matrix.curve }} && cargo test --features 'r1cs'"