ci: Isolate light-client testing to save CI minutes

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2024-02-29 18:55:05 +02:00
parent ca60c318d1
commit 3c58c5ec88
+415 -415
View File
@@ -22,352 +22,352 @@ env:
WASM_BINDGEN_TEST_TIMEOUT: 60 WASM_BINDGEN_TEST_TIMEOUT: 60
jobs: jobs:
fmt: # fmt:
name: Cargo fmt # name: Cargo fmt
runs-on: ubuntu-latest # runs-on: ubuntu-latest
steps: # steps:
- name: Checkout sources # - name: Checkout sources
uses: actions/checkout@v4 # uses: actions/checkout@v4
- name: Install Rust nightly toolchain # - name: Install Rust nightly toolchain
uses: actions-rs/toolchain@v1 # uses: actions-rs/toolchain@v1
with: # with:
profile: minimal # profile: minimal
toolchain: stable # toolchain: stable
override: true # override: true
components: rustfmt # components: rustfmt
- name: Rust Cache # - name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 # uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- name: Cargo fmt # - name: Cargo fmt
uses: actions-rs/cargo@v1.0.3 # uses: actions-rs/cargo@v1.0.3
with: # with:
command: fmt # command: fmt
args: --all -- --check # args: --all -- --check
- if: "failure()" # - if: "failure()"
uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4 # uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4
machete: # machete:
name: "Check unused dependencies" # name: "Check unused dependencies"
runs-on: ubuntu-latest # runs-on: ubuntu-latest
steps: # steps:
- name: Checkout sources # - name: Checkout sources
uses: actions/checkout@v4 # uses: actions/checkout@v4
- name: Use substrate and polkadot node binaries # - name: Use substrate and polkadot node binaries
uses: ./.github/workflows/actions/use-nodes # uses: ./.github/workflows/actions/use-nodes
- name: Install Rust stable toolchain # - name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1 # uses: actions-rs/toolchain@v1
with: # with:
profile: minimal # profile: minimal
toolchain: stable # toolchain: stable
override: true # override: true
- name: Rust Cache # - name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 # uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- name: Install cargo-machete # - name: Install cargo-machete
run: cargo install cargo-machete # run: cargo install cargo-machete
- name: Check unused dependencies # - name: Check unused dependencies
uses: actions-rs/cargo@v1.0.3 # uses: actions-rs/cargo@v1.0.3
with: # with:
command: machete # command: machete
- if: "failure()" # - if: "failure()"
uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4 # uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4
clippy: # clippy:
name: Cargo clippy # name: Cargo clippy
runs-on: ubuntu-latest # runs-on: ubuntu-latest
needs: [fmt, machete] # needs: [fmt, machete]
steps: # steps:
- name: Checkout sources # - name: Checkout sources
uses: actions/checkout@v4 # uses: actions/checkout@v4
- name: Use substrate and polkadot node binaries # - name: Use substrate and polkadot node binaries
uses: ./.github/workflows/actions/use-nodes # uses: ./.github/workflows/actions/use-nodes
- name: Install Rust stable toolchain # - name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1 # uses: actions-rs/toolchain@v1
with: # with:
profile: minimal # profile: minimal
toolchain: stable # toolchain: stable
components: clippy # components: clippy
override: true # override: true
- name: Rust Cache # - name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 # uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- name: Run clippy # - name: Run clippy
run: | # run: |
cargo clippy --all-targets --features unstable-light-client -- -D warnings # cargo clippy --all-targets --features unstable-light-client -- -D warnings
cargo clippy -p subxt-lightclient --no-default-features --features web -- -D warnings # cargo clippy -p subxt-lightclient --no-default-features --features web -- -D warnings
cargo clippy -p subxt --no-default-features --features web -- -D warnings # cargo clippy -p subxt --no-default-features --features web -- -D warnings
cargo clippy -p subxt --no-default-features --features web,unstable-light-client -- -D warnings # cargo clippy -p subxt --no-default-features --features web,unstable-light-client -- -D warnings
- if: "failure()" # - if: "failure()"
uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4 # uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4
wasm_clippy: # wasm_clippy:
name: Cargo clippy (WASM) # name: Cargo clippy (WASM)
runs-on: ubuntu-latest # runs-on: ubuntu-latest
needs: [fmt, machete] # needs: [fmt, machete]
steps: # steps:
- name: Checkout sources # - name: Checkout sources
uses: actions/checkout@v4 # uses: actions/checkout@v4
- name: Use substrate and polkadot node binaries # - name: Use substrate and polkadot node binaries
uses: ./.github/workflows/actions/use-nodes # uses: ./.github/workflows/actions/use-nodes
- name: Install Rust stable toolchain # - name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1 # uses: actions-rs/toolchain@v1
with: # with:
profile: minimal # profile: minimal
toolchain: stable # toolchain: stable
target: wasm32-unknown-unknown # target: wasm32-unknown-unknown
override: true # override: true
- name: Rust Cache # - name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 # uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- name: Run clippy # - name: Run clippy
uses: actions-rs/cargo@v1 # uses: actions-rs/cargo@v1
with: # with:
command: clippy # command: clippy
args: -p subxt --no-default-features --features web,unstable-light-client,jsonrpsee --target wasm32-unknown-unknown -- -D warnings # args: -p subxt --no-default-features --features web,unstable-light-client,jsonrpsee --target wasm32-unknown-unknown -- -D warnings
- if: "failure()" # - if: "failure()"
uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4 # uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4
check: # check:
name: Cargo check # name: Cargo check
runs-on: ubuntu-latest # runs-on: ubuntu-latest
needs: [fmt, machete] # needs: [fmt, machete]
steps: # steps:
- name: Checkout sources # - name: Checkout sources
uses: actions/checkout@v4 # uses: actions/checkout@v4
- name: Use substrate and polkadot node binaries # - name: Use substrate and polkadot node binaries
uses: ./.github/workflows/actions/use-nodes # uses: ./.github/workflows/actions/use-nodes
- name: Install Rust stable toolchain # - name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1 # uses: actions-rs/toolchain@v1
with: # with:
profile: minimal # profile: minimal
toolchain: stable # toolchain: stable
override: true # override: true
- name: Rust Cache # - name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 # uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- name: Install cargo-hack # - name: Install cargo-hack
uses: baptiste0928/cargo-install@v3 # uses: baptiste0928/cargo-install@v3
with: # with:
crate: cargo-hack # crate: cargo-hack
version: 0.5 # version: 0.5
# A basic check over all targets together. This may lead to features being combined etc, # # A basic check over all targets together. This may lead to features being combined etc,
# and doesn't test combinations of different features. # # and doesn't test combinations of different features.
- name: Cargo check all targets. # - name: Cargo check all targets.
run: cargo check --all-targets # run: cargo check --all-targets
# Next, check subxt features. # # Next, check subxt features.
# - `native` feature must always be enabled # # - `native` feature must always be enabled
# - `web` feature is always ignored. # # - `web` feature is always ignored.
# - This means, don't check --no-default-features and don't try enabling --all-features; both will fail # # - This means, don't check --no-default-features and don't try enabling --all-features; both will fail
- name: Cargo hack; check each subxt feature # - name: Cargo hack; check each subxt feature
run: cargo hack -p subxt --each-feature check --exclude-no-default-features --exclude-all-features --exclude-features web --features native # run: cargo hack -p subxt --each-feature check --exclude-no-default-features --exclude-all-features --exclude-features web --features native
# Subxt-signer has the "subxt" features enabled in the "check all targets" test. Run it on its own to # # Subxt-signer has the "subxt" features enabled in the "check all targets" test. Run it on its own to
# check it without. We can't enable subxt or web features here, so no cargo hack. # # check it without. We can't enable subxt or web features here, so no cargo hack.
- name: Cargo check subxt-signer # - name: Cargo check subxt-signer
run: | # run: |
cargo check -p subxt-signer # cargo check -p subxt-signer
cargo check -p subxt-signer --no-default-features --features sr25519,native # cargo check -p subxt-signer --no-default-features --features sr25519,native
cargo check -p subxt-signer --no-default-features --features ecdsa,native # cargo check -p subxt-signer --no-default-features --features ecdsa,native
# We can't enable web features here, so no cargo hack. # # We can't enable web features here, so no cargo hack.
- name: Cargo check subxt-lightclient # - name: Cargo check subxt-lightclient
run: cargo check -p subxt-lightclient # run: cargo check -p subxt-lightclient
# Next, check each other package in isolation. # # Next, check each other package in isolation.
- name: Cargo hack; check each feature/crate on its own # - name: Cargo hack; check each feature/crate on its own
run: cargo hack --exclude subxt --exclude subxt-signer --exclude subxt-lightclient --exclude-all-features --each-feature check --workspace # run: cargo hack --exclude subxt --exclude subxt-signer --exclude subxt-lightclient --exclude-all-features --each-feature check --workspace
# Check the parachain-example code, which isn't a part of the workspace so is otherwise ignored. # # Check the parachain-example code, which isn't a part of the workspace so is otherwise ignored.
- name: Cargo check parachain-example # - name: Cargo check parachain-example
run: cargo check --manifest-path examples/parachain-example/Cargo.toml # run: cargo check --manifest-path examples/parachain-example/Cargo.toml
- if: "failure()" # - if: "failure()"
uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4 # uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4
wasm_check: # wasm_check:
name: Cargo check (WASM) # name: Cargo check (WASM)
runs-on: ubuntu-latest # runs-on: ubuntu-latest
needs: [fmt, machete] # needs: [fmt, machete]
steps: # steps:
- name: Checkout sources # - name: Checkout sources
uses: actions/checkout@v4 # uses: actions/checkout@v4
- name: Install Rust stable toolchain # - name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1 # uses: actions-rs/toolchain@v1
with: # with:
profile: minimal # profile: minimal
toolchain: stable # toolchain: stable
target: wasm32-unknown-unknown # target: wasm32-unknown-unknown
override: true # override: true
- name: Rust Cache # - name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 # uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
# Check WASM examples, which aren't a part of the workspace and so are otherwise missed: # # Check WASM examples, which aren't a part of the workspace and so are otherwise missed:
- name: Cargo check WASM examples # - name: Cargo check WASM examples
run: | # run: |
cargo check --manifest-path examples/wasm-example/Cargo.toml --target wasm32-unknown-unknown # cargo check --manifest-path examples/wasm-example/Cargo.toml --target wasm32-unknown-unknown
- if: "failure()" # - if: "failure()"
uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4 # uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4
docs: # docs:
name: Check documentation and run doc tests # name: Check documentation and run doc tests
runs-on: ubuntu-latest # runs-on: ubuntu-latest
needs: [fmt, machete] # needs: [fmt, machete]
steps: # steps:
- name: Checkout sources # - name: Checkout sources
uses: actions/checkout@v4 # uses: actions/checkout@v4
- name: Use substrate and polkadot node binaries # - name: Use substrate and polkadot node binaries
uses: ./.github/workflows/actions/use-nodes # uses: ./.github/workflows/actions/use-nodes
- name: Install Rust stable toolchain # - name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1 # uses: actions-rs/toolchain@v1
with: # with:
profile: minimal # profile: minimal
toolchain: stable # toolchain: stable
override: true # override: true
- name: Rust Cache # - name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 # uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- name: Check internal documentation links # - name: Check internal documentation links
run: RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc -vv --workspace --no-deps --document-private-items # run: RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc -vv --workspace --no-deps --document-private-items
- name: Run cargo test on documentation # - name: Run cargo test on documentation
uses: actions-rs/cargo@v1.0.3 # uses: actions-rs/cargo@v1.0.3
with: # with:
command: test # command: test
args: --doc # args: --doc
- if: "failure()" # - if: "failure()"
uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4 # uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4
tests: # tests:
name: "Test (Native)" # name: "Test (Native)"
runs-on: ubuntu-latest-16-cores # runs-on: ubuntu-latest-16-cores
needs: [clippy, wasm_clippy, check, wasm_check, docs] # needs: [clippy, wasm_clippy, check, wasm_check, docs]
timeout-minutes: 30 # timeout-minutes: 30
steps: # steps:
- name: Checkout sources # - name: Checkout sources
uses: actions/checkout@v4 # uses: actions/checkout@v4
- name: Use substrate and polkadot node binaries # - name: Use substrate and polkadot node binaries
uses: ./.github/workflows/actions/use-nodes # uses: ./.github/workflows/actions/use-nodes
- name: Install Rust stable toolchain # - name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1 # uses: actions-rs/toolchain@v1
with: # with:
profile: minimal # profile: minimal
toolchain: stable # toolchain: stable
override: true # override: true
- name: Rust Cache # - name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 # uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- name: Install cargo-nextest # - name: Install cargo-nextest
run: cargo install cargo-nextest # run: cargo install cargo-nextest
- name: Run tests # - name: Run tests
uses: actions-rs/cargo@v1.0.3 # uses: actions-rs/cargo@v1.0.3
with: # with:
command: nextest # command: nextest
args: run --workspace # args: run --workspace
- if: "failure()" # - if: "failure()"
uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4 # uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4
unstable_backend_tests: # unstable_backend_tests:
name: "Test (Unstable Backend)" # name: "Test (Unstable Backend)"
runs-on: ubuntu-latest-16-cores # runs-on: ubuntu-latest-16-cores
needs: [clippy, wasm_clippy, check, wasm_check, docs] # needs: [clippy, wasm_clippy, check, wasm_check, docs]
timeout-minutes: 30 # timeout-minutes: 30
steps: # steps:
- name: Checkout sources # - name: Checkout sources
uses: actions/checkout@v4 # uses: actions/checkout@v4
- name: Use substrate and polkadot node binaries # - name: Use substrate and polkadot node binaries
uses: ./.github/workflows/actions/use-nodes # uses: ./.github/workflows/actions/use-nodes
- name: Install Rust stable toolchain # - name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1 # uses: actions-rs/toolchain@v1
with: # with:
profile: minimal # profile: minimal
toolchain: stable # toolchain: stable
override: true # override: true
- name: Rust Cache # - name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 # uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- name: Install cargo-nextest # - name: Install cargo-nextest
run: cargo install cargo-nextest # run: cargo install cargo-nextest
- name: Run tests # - name: Run tests
uses: actions-rs/cargo@v1.0.3 # uses: actions-rs/cargo@v1.0.3
with: # with:
command: nextest # command: nextest
args: run --workspace --features unstable-backend-client # args: run --workspace --features unstable-backend-client
- if: "failure()" # - if: "failure()"
uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4 # uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4
light_client_tests: # light_client_tests:
name: "Test (Light Client)" # name: "Test (Light Client)"
runs-on: ubuntu-latest # runs-on: ubuntu-latest
needs: [clippy, wasm_clippy, check, wasm_check, docs] # needs: [clippy, wasm_clippy, check, wasm_check, docs]
timeout-minutes: 15 # timeout-minutes: 15
steps: # steps:
- name: Checkout sources # - name: Checkout sources
uses: actions/checkout@v4 # uses: actions/checkout@v4
- name: Use substrate and polkadot node binaries # - name: Use substrate and polkadot node binaries
uses: ./.github/workflows/actions/use-nodes # uses: ./.github/workflows/actions/use-nodes
- name: Install Rust stable toolchain # - name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1 # uses: actions-rs/toolchain@v1
with: # with:
profile: minimal # profile: minimal
toolchain: stable # toolchain: stable
override: true # override: true
- name: Rust Cache # - name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 # uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- name: Run tests # - name: Run tests
uses: actions-rs/cargo@v1.0.3 # uses: actions-rs/cargo@v1.0.3
with: # with:
command: test # command: test
args: --release --package integration-tests --features unstable-light-client # args: --release --package integration-tests --features unstable-light-client
- if: "failure()" # - if: "failure()"
uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4 # uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4
light_client_long_running_tests: light_client_long_running_tests:
name: "Test (Light Client Long Running)" name: "Test (Light Client Long Running)"
runs-on: ubuntu-latest-16-cores runs-on: ubuntu-latest-16-cores
needs: [clippy, wasm_clippy, check, wasm_check, docs] # needs: [clippy, wasm_clippy, check, wasm_check, docs]
timeout-minutes: 60 timeout-minutes: 60
steps: steps:
- name: Checkout sources - name: Checkout sources
@@ -395,92 +395,92 @@ jobs:
- if: "failure()" - if: "failure()"
uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4 uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4
wasm_tests: # wasm_tests:
name: Test (WASM) # name: Test (WASM)
runs-on: ubuntu-latest # runs-on: ubuntu-latest
needs: [clippy, wasm_clippy, check, wasm_check, docs] # needs: [clippy, wasm_clippy, check, wasm_check, docs]
timeout-minutes: 30 # timeout-minutes: 30
env: # env:
# Set timeout for wasm tests to be much bigger than the default 20 secs. # # Set timeout for wasm tests to be much bigger than the default 20 secs.
WASM_BINDGEN_TEST_TIMEOUT: 300 # WASM_BINDGEN_TEST_TIMEOUT: 300
steps: # steps:
- uses: actions/checkout@v4 # - uses: actions/checkout@v4
- name: Install wasm-pack # - name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh # run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Install firefox # - name: Install firefox
uses: browser-actions/setup-firefox@latest # uses: browser-actions/setup-firefox@latest
- name: Install chrome # - name: Install chrome
uses: browser-actions/setup-chrome@latest # uses: browser-actions/setup-chrome@latest
- name: Rust Cache # - name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 # uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- name: Use substrate and polkadot node binaries # - name: Use substrate and polkadot node binaries
uses: ./.github/workflows/actions/use-nodes # uses: ./.github/workflows/actions/use-nodes
- name: Run subxt WASM tests # - name: Run subxt WASM tests
run: | # run: |
# `listen-addr` is used to configure p2p to accept websocket connections instead of TCP. # # `listen-addr` is used to configure p2p to accept websocket connections instead of TCP.
# `node-key` provides a deterministic p2p address. # # `node-key` provides a deterministic p2p address.
substrate-node --dev --node-key 0000000000000000000000000000000000000000000000000000000000000001 --listen-addr /ip4/0.0.0.0/tcp/30333/ws > /dev/null 2>&1 & # substrate-node --dev --node-key 0000000000000000000000000000000000000000000000000000000000000001 --listen-addr /ip4/0.0.0.0/tcp/30333/ws > /dev/null 2>&1 &
wasm-pack test --headless --firefox # wasm-pack test --headless --firefox
wasm-pack test --headless --chrome # wasm-pack test --headless --chrome
pkill substrate-node # pkill substrate-node
working-directory: testing/wasm-rpc-tests # working-directory: testing/wasm-rpc-tests
- name: Run subxt-lightclient WASM tests # - name: Run subxt-lightclient WASM tests
run: | # run: |
# `listen-addr` is used to configure p2p to accept websocket connections instead of TCP. # # `listen-addr` is used to configure p2p to accept websocket connections instead of TCP.
# `node-key` provides a deterministic p2p address. # # `node-key` provides a deterministic p2p address.
substrate-node --dev --node-key 0000000000000000000000000000000000000000000000000000000000000001 --listen-addr /ip4/0.0.0.0/tcp/30333/ws > /dev/null 2>&1 & # substrate-node --dev --node-key 0000000000000000000000000000000000000000000000000000000000000001 --listen-addr /ip4/0.0.0.0/tcp/30333/ws > /dev/null 2>&1 &
wasm-pack test --headless --firefox # wasm-pack test --headless --firefox
wasm-pack test --headless --chrome # wasm-pack test --headless --chrome
pkill substrate-node # pkill substrate-node
working-directory: testing/wasm-lightclient-tests # working-directory: testing/wasm-lightclient-tests
- name: Run subxt-signer WASM tests # - name: Run subxt-signer WASM tests
run: | # run: |
wasm-pack test --headless --firefox # wasm-pack test --headless --firefox
wasm-pack test --headless --chrome # wasm-pack test --headless --chrome
working-directory: signer/wasm-tests # working-directory: signer/wasm-tests
- if: "failure()" # - if: "failure()"
uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4 # uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4
no-std-tests: # no-std-tests:
name: "Test (no_std)" # name: "Test (no_std)"
runs-on: ubuntu-latest # runs-on: ubuntu-latest
needs: [machete, docs] # needs: [machete, docs]
timeout-minutes: 30 # timeout-minutes: 30
steps: # steps:
- name: Checkout sources # - name: Checkout sources
uses: actions/checkout@v4 # uses: actions/checkout@v4
# Note: needs nighly toolchain because otherwise we cannot define custom lang-items. # # Note: needs nighly toolchain because otherwise we cannot define custom lang-items.
- name: Install Rust nightly toolchain # - name: Install Rust nightly toolchain
uses: actions-rs/toolchain@v1 # uses: actions-rs/toolchain@v1
with: # with:
profile: minimal # profile: minimal
toolchain: nightly # toolchain: nightly
override: true # override: true
target: thumbv7em-none-eabi # target: thumbv7em-none-eabi
- name: Install the gcc-arm-none-eabi linker # - name: Install the gcc-arm-none-eabi linker
run: sudo apt install gcc-arm-none-eabi # run: sudo apt install gcc-arm-none-eabi
- name: Rust Cache # - name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 # uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
# Note: We currently do not have a way to run real tests in a `no_std` environment. # # Note: We currently do not have a way to run real tests in a `no_std` environment.
# We can only make sure that they compile to ARM thumb ISA. # # We can only make sure that they compile to ARM thumb ISA.
# Running the binary and inspecting the output would require an actual machine with matching ISA or some sort of emulator. # # Running the binary and inspecting the output would require an actual machine with matching ISA or some sort of emulator.
- name: Compile `no-std-tests` crate to `thumbv7em-none-eabi` target. # - name: Compile `no-std-tests` crate to `thumbv7em-none-eabi` target.
run: cargo build --target thumbv7em-none-eabi # run: cargo build --target thumbv7em-none-eabi
working-directory: testing/no-std-tests # working-directory: testing/no-std-tests
- if: "failure()" # - if: "failure()"
uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4 # uses: "andymckay/cancel-action@271cfbfa11ca9222f7be99a47e8f929574549e0a" # v0.4