Cleanups; fix potential race condition #5302
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |