-
Notifications
You must be signed in to change notification settings - Fork 2.3k
136 lines (125 loc) · 5 KB
/
web.yml
File metadata and controls
136 lines (125 loc) · 5 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Web
on:
push:
branches: [ 'devnet_*', 'testnet_*' ]
merge_group:
pull_request:
branches:
- "**"
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
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:
changed-files:
runs-on: linera-io-self-hosted-ci
outputs:
should-run: ${{ steps.files-changed.outputs.paths }}
steps:
- uses: actions/checkout@v4
- name: Filter paths
uses: dorny/paths-filter@v3
id: files-changed
with:
predicate-quantifier: 'every'
filters: |
paths:
- '!docker/**'
- '!docker_scylla/**'
- '!configuration/**'
- '!kubernetes/**'
- '!CONTRIBUTING.md'
- '!INSTALL.md'
web:
needs: changed-files
if: needs.changed-files.outputs.should-run == 'true'
runs-on: linera-io-self-hosted-ci
timeout-minutes: 30
steps:
# Install dependencies
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: nanasess/setup-chromedriver@v2
- uses: jetli/wasm-pack-action@v0.4.0
with:
version: v0.13.1
- uses: jetli/wasm-bindgen-action@v0.2.0
with:
version: 0.2.100
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.17
# Setup fixtures
- 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_2.db cargo run --bin linera -- storage initialize --genesis /tmp/local-linera-net/genesis.json
LINERA_STORAGE=rocksdb:/tmp/local-linera-net/client_2.db cargo run --bin linera -- resource-control-policy --http-request-timeout-ms 1000
LINERA_STORAGE=rocksdb:/tmp/local-linera-net/client_2.db cargo run --bin linera -- resource-control-policy --http-request-timeout-ms 500
- name: Deploy the counter application
env:
LINERA_WALLET: /tmp/local-linera-net/wallet_2.json
LINERA_KEYSTORE: /tmp/local-linera-net/keystore_2.json
LINERA_STORAGE: rocksdb:/tmp/local-linera-net/client_2.db
run: |
cargo run --bin linera -- wallet init
cargo run --bin linera -- wallet request-chain
echo LINERA_COUNTER_APPLICATION_ID=$(cargo run --bin linera -- project publish-and-create examples/counter --json-argument 0) >> "$GITHUB_ENV"
- name: Switch to nightly Rust toolchain
run: |
ln -sf toolchains/nightly/rust-toolchain.toml
# Run tests
- name: Test the npm packages
run: |
cd web
pnpm install --frozen-lockfile
(cd @linera/client && pnpm exec playwright install)
pnpm -r run ci
- name: Test `linera-views` on the Web
run: |
cd linera-views
WASM_BINDGEN_TEST_TIMEOUT=300 wasm-pack test --chrome --headless -- --features web-default
- name: Test the `counter` example
run: |
cd examples/counter
pnpm install --frozen-lockfile
LINERA_APPLICATION_ID=$LINERA_COUNTER_APPLICATION_ID pnpm test