33 push :
44 branches : [ main, develop ]
55 pull_request :
6+ paths-ignore : [ "frontend" ]
67 workflow_dispatch :
78
89concurrency :
910 group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1011 cancel-in-progress : true
1112
12- env :
13- RUST_MIN_STACK : 10000000
14-
1513jobs :
1614 ledger-tests :
1715 runs-on : ubuntu-20.04
9997 name : bin
10098 path : target/release/openmina
10199
100+ build_wasm :
101+ runs-on : ubuntu-20.04
102+ steps :
103+ - name : Git checkout
104+ uses : actions/checkout@v4
105+
106+ - name : Setup build dependencies
107+ run : |
108+ sudo apt update
109+ sudo apt install -y protobuf-compiler
110+
111+ - name : Setup Rust
112+ run : |
113+ rustup default 1.77
114+ rustup component add rustfmt
115+ rustup target add wasm32-unknown-unknown
116+
117+ - name : Setup Rust Cache
118+ uses : Swatinem/rust-cache@v2
119+ with :
120+ prefix-key : " v0"
121+
122+ # for now build just p2p as the rest can't yet be compiled to wasm.
123+ - name : Release build
124+ run : |
125+ cargo build --release -p node --target wasm32-unknown-unknown --no-default-features --features p2p-webrtc
126+
102127 build-tests :
103128 runs-on : ubuntu-20.04
104129 steps :
@@ -124,8 +149,8 @@ jobs:
124149 run : |
125150 mkdir -p target/release/tests
126151
127- cargo build --release --features=scenario-generators --package=openmina-node-testing --tests
128- cargo build --release --features=scenario-generators --package=openmina-node-testing --tests --message-format=json > cargo-build-test.json
152+ cargo build --release --tests --package=openmina-node-testing --package=cli
153+ cargo build --release --tests --package=openmina-node-testing --package=cli --message-format=json > cargo-build-test.json
129154 jq -r '. | select(.executable != null and (.target.kind | (contains(["test"])))) | [.target.name, .executable ] | @tsv' cargo-build-test.json > tests.tsv
130155 while read NAME FILE; do cp -a $FILE target/release/tests/$NAME; done < tests.tsv
131156
@@ -176,7 +201,7 @@ jobs:
176201 needs : [ build-tests ]
177202 runs-on : ubuntu-20.04
178203 container :
179- image : minaprotocol/mina-daemon:2 .0.0berkeley-rc1-1551e2f- focal-berkeley
204+ image : minaprotocol/mina-daemon:3 .0.0-dc6bf78- focal-devnet
180205 strategy :
181206 matrix :
182207 test : [p2p_basic_connections, p2p_basic_incoming, p2p_basic_outgoing, p2p_pubsub]
@@ -201,15 +226,15 @@ jobs:
201226 # TODO: query cluster for actual addresses, or specify then on deployment
202227 env :
203228 PEERS : |
204- /ip4/135.181.217.23/tcp/31881/p2p/12D3KooWKiKQkUTTZ6u8HDk471ZQE2vStpEDnySiKDrYgZGfEcsF
205- /ip4/135.181.217.23/tcp/30386/p2p/12D3KooWBHknA3ty2tk4u3N6Rwnjs5YwYaxHT9dURf7zGeBJ4VJG
206- /ip4/135.181.217.23/tcp/32272/p2p/12D3KooWDZDH6ucaZY4bU2R8Xy9T1iy4PGtaZ8vEWeuGEeLaQEg5
207- /ip4/135.181.217.23/tcp/32218/p2p/12D3KooWMenq7gPcF7utkZao8WLtjMqsZkY7LeLD1Y9q9YyQZnkG
208- /ip4/135.181.217.23/tcp/30798/p2p/12D3KooWMMsF7dYbn4Szf7TvrRofuK53W3zj6TDKgxAFSWYypLsB
209- /ip4/135.181.217.23/tcp/31631/p2p/12D3KooWNeaaS6wpPSa41qkxQWaeauDR51WCNnLUyd5CcjBBiNTq
210- /ip4/135.181.217.23/tcp/30196/p2p/12D3KooWCBTaSVMxDT1SUoeSg3PUsVL1Df1hDxkSvN544i7tsE76
211- /ip4/135.181.217.23/tcp/30790/p2p/12D3KooWG7egucvX5sompG2euhaPL4QQ3BdHJrLS7HGWyiHyoD5y
212- /ip4/135.181.217.23/tcp/30070/p2p/12D3KooWFG5dhmgS6rb8NdoNbiK7Vf6TqTQDTYxq18DVkmPwsgfg
229+ /ip4/135.181.217.23/tcp/31881/p2p/12D3KooWAsfrqsjuYwfQa4yCxnJdtADwKB3PWpwq133LcndiwQjr
230+ /ip4/135.181.217.23/tcp/30386/p2p/12D3KooWQHgBVfC6YsPKYprzeC6pVd6fhEzZ1yMs8iSd3rvtQRCs
231+ /ip4/135.181.217.23/tcp/32272/p2p/12D3KooWBXR2QujRvh7DCpVHLqdQ7Q4BTQ4DdciznYpxRvZnSH5q
232+ /ip4/135.181.217.23/tcp/32218/p2p/12D3KooWFScvpnxJYpfVW7dQmo6oG19GUv33ZcePmFeL86RrtYeD
233+ /ip4/135.181.217.23/tcp/30798/p2p/12D3KooWCzF1D6ftm63dtzuwKpp4imT9wFkwDamMBrod1VAiJqq5
234+ /ip4/135.181.217.23/tcp/31631/p2p/12D3KooWAHfVgQS2wfW8ZG9LcguJkvum7TbQX5SgvLyq4c5C6F6G
235+ /ip4/135.181.217.23/tcp/30196/p2p/12D3KooWL7Emi3KMjrCuy1rfaneViVxaSyJZUNGHz9EorhHHanJ7
236+ /ip4/135.181.217.23/tcp/30790/p2p/12D3KooWCmjkAxh4C3MktmphDKXiSN2bBUNNpVDjL1dEkVsB7XVn
237+ /ip4/135.181.217.23/tcp/30070/p2p/12D3KooWMxhbVutFLjHTizVBd6LyLjp6dnuNmimHT2oCDDR9FSHj
213238 outputs :
214239 peers : ${{ steps.peers.outputs.peers }}
215240 steps :
@@ -229,10 +254,13 @@ jobs:
229254 # - build-tests-webrtc
230255 runs-on : ubuntu-20.04
231256 container :
232- image : minaprotocol/mina-daemon:2 .0.0berkeley-rc1-1551e2f- focal-berkeley
257+ image : minaprotocol/mina-daemon:3 .0.0-dc6bf78- focal-devnet
233258 env :
234259 # to allow local addrs discovery
235260 OPENMINA_DISCOVERY_FILTER_ADDR : false
261+ # to allow connection with replayer
262+ # TODO: remove when replayer supports identify
263+ KEEP_CONNECTION_WITH_UNKNOWN_STREAM : true
236264 OPENMINA_SCENARIO_SEEDS : ${{ needs.k8s-peers.outputs.peers }}
237265 strategy :
238266 matrix :
@@ -259,65 +287,92 @@ jobs:
259287 run : |
260288 ./${{ matrix.test }} --test-threads=1
261289
290+ record-replay-tests :
291+ needs :
292+ - k8s-peers
293+ - build-tests
294+ # - build-tests-webrtc
295+ runs-on : ubuntu-20.04
296+ container :
297+ image : minaprotocol/mina-daemon:3.0.0-dc6bf78-focal-devnet
298+ env :
299+ # to allow local addrs discovery
300+ OPENMINA_DISCOVERY_FILTER_ADDR : false
301+ OPENMINA_SCENARIO_SEEDS : ${{ needs.k8s-peers.outputs.peers }}
302+ strategy :
303+ matrix :
304+ test : [record_replay]
305+ fail-fast : false
306+
307+ steps :
308+ - name : Download tests
309+ uses : actions/download-artifact@v4
310+ with :
311+ pattern : tests*
312+ merge-multiple : true
313+
314+ - name : Setup permissions
315+ run : |
316+ chmod +x ./${{ matrix.test }}
317+
318+ - name : Run the test
319+ run : |
320+ ./${{ matrix.test }} --test-threads=1
321+
262322
263323 bootstrap-test :
264- needs : [ k8s-peers, build ]
324+ needs : [ k8s-peers, build, build-tests ]
265325 runs-on : ubuntu-20.04
266326 env :
267- PEERS : ${{ needs.k8s-peers.outputs.peers }}
327+ PEERS_LIST : ${{ needs.k8s-peers.outputs.peers }}
328+ PEER_LIST_FILE : peer-list.txt
329+ WORK_DIR : data
268330 steps :
269331 - name : Download binary
270332 uses : actions/download-artifact@v4
271333 with :
272334 name : bin
273335
274- - name : Bootstrap node
336+ - name : Download test
337+ uses : actions/download-artifact@v4
338+ with :
339+ pattern : tests*
340+ merge-multiple : true
341+
342+ - name : Fix permissions
275343 run : |
276- set -eu
277- chmod +x ./openmina
278- ./openmina node --no-peers-discovery --peers $PEERS 2>&1 | tee run.log &
279- PID=$!
280- TIME=10
281- SLEEP=10
282- ATTEMPTS=$((TIME * 60 / SLEEP))
283-
284- healthy() {
285- curl -fs -m 5 localhost:3000/healthz
286- }
344+ chmod +x bootstrap openmina
287345
288- ready() {
289- curl -fs -m 5 localhost:3000/readyz
290- }
346+ - name : Peer List File
347+ run : |
348+ for PEER in $PEERS_LIST; do echo $PEER; done > $PEER_LIST_FILE
349+ cat $PEER_LIST_FILE
291350
292- ready3() {
293- ready && sleep 10 && ready && sleep 10 && ready
351+ - name : Bootstrap node
352+ env :
353+ OPENMINA_COMMAND : ./openmina
354+ NO_PEER_DISCOVERY : " true"
355+ OUT_PATH : ${{ env.WORK_DIR }}/logs/bootstrap_output
356+ RECORD : state-with-input-actions
357+ run : |
358+ mkdir -p $OUT_PATH
359+ OPENMINA_COMMAND=./openmina NO_PEER_DISCOVERY=true ./bootstrap --nocapture || {
360+ echo "::group::Stderr"
361+ cat $OUT_PATH.stderr
362+ echo "::endgroup::"
363+ exit 1
294364 }
295365
296- while ! healthy; do
297- echo "::notice::The node is not healthy yet"
298- ATTEMPTS=$((ATTEMPTS-1))
299- if [ "${ATTEMPTS}" -eq 0 ]; then
300- echo "::error::Cannot bootsrtap within $TIME minutes"
301- exit 1
302- fi
303- sleep $SLEEP
304- done
305- echo "::notice::The node is healthy"
306-
307- while ! ready3; do
308- echo "::notice::The node is not bootstrapped yet"
309- ATTEMPTS=$((ATTEMPTS-1))
310- if [ "${ATTEMPTS}" -eq 0 ]; then
311- echo "::error::Cannot bootsrtap within $TIME minutes"
312- exit 1
313- fi
314- sleep $SLEEP
315- done
316- echo "::notice::The node is bootstrapped"
317-
318- - name : Upload run.log
366+ - name : Upload logs
367+ uses : actions/upload-artifact@v4
368+ with :
369+ name : bootstrap-logs
370+ path : ${{ env.WORK_DIR }}/logs/*
371+ if : ${{ failure() }}
372+
373+ - name : Upload record
319374 uses : actions/upload-artifact@v4
320375 with :
321- name : bootstrap-log
322- path : run.log
376+ name : bootstrap-record
377+ path : ${{ env.WORK_DIR }}/recorder/*
323378 if : ${{ failure() }}
0 commit comments