@@ -26,22 +26,18 @@ jobs:
2626 sudo apt update
2727 sudo apt install -y protobuf-compiler
2828 - name : Setup Rust
29- run : |
30- # Nightly to be able to use `--report-time` below
31- rustup install nightly
32- rustup override set nightly
29+ uses : dtolnay/rust-toolchain@stable
30+ with :
31+ toolchain : nightly
3332 - name : Download circuits files
3433 run : |
35- git clone --depth 1 https://github.com/openmina/circuit-blobs.git
36- ln -s -b $PWD/circuit-blobs/* ledger/
34+ make download-circuits
3735 - name : Build ledger tests
3836 run : |
39- cd ledger
40- cargo build --release --tests
37+ make build-ledger
4138 - name : Run ledger tests
4239 run : |
43- cd ledger
44- cargo test --release -- -Z unstable-options --report-time
40+ make test-ledger
4541
4642 ledger-32x9-tests :
4743 runs-on : ubuntu-22.04
@@ -53,14 +49,12 @@ jobs:
5349 sudo apt update
5450 sudo apt install -y protobuf-compiler
5551 - name : Setup Rust
56- run : |
57- # Nightly to be able to use `--report-time` below
58- rustup install nightly
59- rustup override set nightly
52+ uses : dtolnay/rust-toolchain@stable
53+ with :
54+ toolchain : nightly
6055 - name : Download circuits files
6156 run : |
62- git clone --depth 1 https://github.com/openmina/circuit-blobs.git
63- ln -s -b $PWD/circuit-blobs/* ledger/
57+ make download-circuits
6458 - name : Enable 32x9 fields implementation
6559 run : |
6660 cargo install sd
@@ -70,12 +64,10 @@ jobs:
7064 cat ./Cargo.toml
7165 - name : Build ledger tests
7266 run : |
73- cd ledger
74- cargo build --release --tests
67+ make build-ledger
7568 - name : Run ledger tests
7669 run : |
77- cd ledger
78- cargo test --release -- -Z unstable-options --report-time
70+ make test-ledger
7971
8072 vrf-tests :
8173 runs-on : ubuntu-22.04
@@ -87,18 +79,15 @@ jobs:
8779 sudo apt update
8880 sudo apt install -y protobuf-compiler
8981 - name : Setup Rust
90- run : |
91- # Nightly to be able to use `--report-time` below
92- rustup install nightly
93- rustup override set nightly
82+ uses : dtolnay/rust-toolchain@stable
83+ with :
84+ toolchain : nightly
9485 - name : Build vrf tests
9586 run : |
96- cd vrf
97- cargo build --release --tests
87+ make build-vrf
9888 - name : Run vrf tests
9989 run : |
100- cd vrf
101- cargo test --release -- -Z unstable-options --report-time
90+ make test-vrf
10291
10392 p2p-tests :
10493 runs-on : ubuntu-22.04
@@ -112,9 +101,10 @@ jobs:
112101 sudo apt install -y protobuf-compiler
113102
114103 - name : Setup Rust
115- run : |
116- rustup default 1.84
117- rustup component add rustfmt
104+ uses : dtolnay/rust-toolchain@stable
105+ with :
106+ components : rustfmt
107+ toolchain : 1.84
118108
119109 - name : Setup Rust Cache
120110 uses : Swatinem/rust-cache@v2
@@ -123,8 +113,7 @@ jobs:
123113
124114 - name : Test p2p crate
125115 run : |
126- cargo test -p p2p --tests
127-
116+ make test-p2p
128117
129118 build :
130119 runs-on : ubuntu-22.04
@@ -138,9 +127,10 @@ jobs:
138127 sudo apt install -y protobuf-compiler
139128
140129 - name : Setup Rust
141- run : |
142- rustup default 1.84
143- rustup component add rustfmt
130+ uses : dtolnay/rust-toolchain@stable
131+ with :
132+ components : rustfmt
133+ toolchain : 1.84
144134
145135 - name : Setup Rust Cache
146136 uses : Swatinem/rust-cache@v2
@@ -149,7 +139,7 @@ jobs:
149139
150140 - name : Release build
151141 run : |
152- cargo build -- release --bin openmina
142+ make build- release
153143
154144 - name : Upload binaries
155145 uses : actions/upload-artifact@v4
@@ -169,9 +159,13 @@ jobs:
169159 sudo apt install -y protobuf-compiler
170160
171161 - name : Setup Rust
162+ uses : dtolnay/rust-toolchain@stable
163+ with :
164+ components : rustfmt, rust-src
165+ toolchain : nightly
166+
167+ - name : Install wasm32 and wasm-bindgen-cli
172168 run : |
173- rustup default nightly
174- rustup component add rustfmt rust-src
175169 rustup target add wasm32-unknown-unknown
176170 cargo install -f wasm-bindgen-cli --version 0.2.99
177171
@@ -182,10 +176,7 @@ jobs:
182176
183177 - name : Release build
184178 run : |
185- cd node/web
186- rustup component add rust-src rustfmt --toolchain nightly-x86_64-unknown-linux-gnu
187- cargo +nightly build --release --target wasm32-unknown-unknown
188- wasm-bindgen --keep-debug --web --out-dir pkg ../../target/wasm32-unknown-unknown/release/openmina_node_web.wasm
179+ make build-wasm
189180
190181 build-tests :
191182 runs-on : ubuntu-22.04
@@ -199,9 +190,10 @@ jobs:
199190 sudo apt install -y protobuf-compiler
200191
201192 - name : Setup Rust
202- run : |
203- rustup default 1.84
204- rustup component add rustfmt
193+ uses : dtolnay/rust-toolchain@stable
194+ with :
195+ components : rustfmt
196+ toolchain : 1.84
205197
206198 - name : Setup Rust Cache
207199 uses : Swatinem/rust-cache@v2
@@ -235,9 +227,10 @@ jobs:
235227 sudo apt install -y protobuf-compiler
236228
237229 - name : Setup Rust
238- run : |
239- rustup default 1.84
240- rustup component add rustfmt
230+ uses : dtolnay/rust-toolchain@stable
231+ with :
232+ components : rustfmt
233+ toolchain : 1.84
241234
242235 - name : Setup Rust Cache
243236 uses : Swatinem/rust-cache@v2
@@ -246,12 +239,7 @@ jobs:
246239
247240 - name : Build tests
248241 run : |
249- mkdir -p target/release/tests
250-
251- cargo build --release --features=scenario-generators,p2p-webrtc --package=openmina-node-testing --tests
252- cargo build --release --features=scenario-generators,p2p-webrtc --package=openmina-node-testing --tests --message-format=json > cargo-build-test.json
253- jq -r '. | select(.executable != null and (.target.kind | (contains(["test"])))) | [.target.name, .executable ] | @tsv' cargo-build-test.json > tests.tsv
254- while read NAME FILE; do cp -a $FILE target/release/tests/webrtc_$NAME; done < tests.tsv
242+ make build-tests-webrtc
255243
256244 - name : Upload tests
257245 uses : actions/upload-artifact@v4
0 commit comments