Skip to content

Replace wasm_thread with web-thread #1104

Replace wasm_thread with web-thread

Replace wasm_thread with web-thread #1104

Workflow file for this run

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
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:
changed-files:
runs-on: ubuntu-latest
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: ubuntu-latest
timeout-minutes: 30
steps:
# Install dependencies
- uses: actions/checkout@v4
- name: Switch to nightly Rust toolchain
run: |
ln -sf toolchains/nightly/rust-toolchain.toml
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: nanasess/setup-chromedriver@v2
- uses: jetli/[email protected]
with:
version: v0.13.1
- uses: jetli/[email protected]
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_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
# 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