diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 796393fb8b4..a61e4e4cc8d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -71,18 +71,25 @@ jobs: - name: Run the storage-service instance run: | cargo run --release -p linera-storage-service -- memory --endpoint $LINERA_STORAGE_SERVICE & + - name: Wait for storage service to be ready + run: | + until nc -z 127.0.0.1 1235; do sleep 1; done + - name: Build binaries + run: | + cargo build --features storage-service --bin linera-server --bin linera-proxy --bin linera - name: Run the validators run: | - cargo build --features storage-service mkdir /tmp/local-linera-net - cargo run --features storage-service --bin linera -- net up --storage service:tcp:$LINERA_STORAGE_SERVICE:table --policy-config testnet --path /tmp/local-linera-net --validators 4 --shards 4 & + cargo run --features storage-service --bin linera -- net up --storage service:tcp:$LINERA_STORAGE_SERVICE:table --policy-config testnet --path /tmp/local-linera-net --validators 2 --shards 2 & - name: Create two epochs and run the faucet # See https://github.com/linera-io/linera-protocol/pull/2835 for details. run: | - cargo build --bin linera cargo run --bin linera -- resource-control-policy --http-request-timeout-ms 1000 cargo run --bin linera -- resource-control-policy --http-request-timeout-ms 500 cargo run --bin linera -- faucet --amount 1000 --port 8079 & + - name: Wait for faucet to be ready + run: | + until curl -s http://localhost:8079 >/dev/null; do sleep 1; done - name: Run the remote-net tests run: | cargo test -p linera-service remote_net_grpc --features remote-net @@ -193,6 +200,9 @@ jobs: - name: Run the storage-service instance run: | cargo run --release -p linera-storage-service -- memory --endpoint $LINERA_STORAGE_SERVICE & + - name: Wait for storage service to be ready + run: | + until nc -z 127.0.0.1 1235; do sleep 1; done - name: Run the benchmark test run: | cargo build --locked -p linera-service --bin linera-benchmark --features storage-service @@ -250,6 +260,9 @@ jobs: - name: Run the storage-service instance run: | cargo run --release -p linera-storage-service -- memory --endpoint $LINERA_STORAGE_SERVICE & + - name: Wait for storage service to be ready + run: | + until nc -z 127.0.0.1 1235; do sleep 1; done - name: Run Ethereum tests run: | cargo test -p linera-ethereum --features ethereum @@ -274,9 +287,14 @@ jobs: run: | cd examples cargo build --locked --release --target wasm32-unknown-unknown - - name: Run the storage-service instance and the storage-service tests + - name: Run the storage-service instance run: | cargo run --release -p linera-storage-service -- memory --endpoint $LINERA_STORAGE_SERVICE & + - name: Wait for storage service to be ready + run: | + until nc -z 127.0.0.1 1235; do sleep 1; done + - name: Run the storage-service tests + run: | cargo test --features storage-service -- storage_service --nocapture web: