forked from linera-io/linera-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (65 loc) · 3.05 KB
/
remote-net-test.yml
File metadata and controls
71 lines (65 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Remote Net Test
on:
push:
branches: [ 'devnet_*', 'testnet_*' ]
pull_request:
merge_group:
workflow_dispatch:
# This allows a subsequently queued workflow run to interrupt previous runs on pull requests
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.run_id }}'
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: full
# We allow redundant explicit links because `cargo rdme` doesn't know how to resolve implicit intra-crate links.
RUSTDOCFLAGS: -A rustdoc::redundant_explicit_links -D warnings
RUSTFLAGS: -D warnings
RUSTUP_MAX_RETRIES: 10
RUST_LOG: linera=debug
RUST_LOG_FORMAT: plain
LINERA_STORAGE_SERVICE: 127.0.0.1:1235
LINERA_WALLET: /tmp/local-linera-net/wallet_0.json
LINERA_KEYSTORE: /tmp/local-linera-net/keystore_0.json
LINERA_STORAGE: rocksdb:/tmp/local-linera-net/client_0.db
LINERA_FAUCET_URL: http://localhost:8079
permissions:
contents: read
jobs:
remote-net-test:
if: ${{ github.event_name == 'merge_group' }}
runs-on: ubuntu-latest-8-cores
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- 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 ${LINERA_STORAGE_SERVICE/:/ }; 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 and faucet, wait for faucet to be ready
run: |
FAUCET_PORT=$(echo "$LINERA_FAUCET_URL" | cut -d: -f3)
LOG_FILE="/tmp/linera-net-up.log"
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 2 --shards 2 --with-faucet --faucet-port $FAUCET_PORT --faucet-amount 1000 > "$LOG_FILE" 2>&1 &
FAUCET_PID=$!
bash scripts/wait-for-kubernetes-service.sh "$LINERA_FAUCET_URL" "$FAUCET_PID" "$LOG_FILE"
# Create two epochs
# See https://github.com/linera-io/linera-protocol/pull/2835 for details.
LINERA_STORAGE=rocksdb:/tmp/local-linera-net/client_1.db cargo run --bin linera -- storage initialize --genesis /tmp/local-linera-net/genesis.json
LINERA_STORAGE=rocksdb:/tmp/local-linera-net/client_1.db cargo run --bin linera -- resource-control-policy --http-request-timeout-ms 1000
LINERA_STORAGE=rocksdb:/tmp/local-linera-net/client_1.db cargo run --bin linera -- resource-control-policy --http-request-timeout-ms 500
- name: Run the remote-net tests
run: |
cargo test -p linera-service remote_net_grpc --features remote-net