mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 15:57:55 +00:00
Initial rebrand from paritytech/subxt to pezkuwichain/pezkuwi-subxt
- Renamed all subxt crates to pezkuwi-subxt - Updated internal references - Configured for Pezkuwi ecosystem
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
# use-nodes
|
||||
|
||||
This action downloads the substrate and polkadot binaries produced from the `build-nodes` workflow and puts them into the `$PATH`.
|
||||
@@ -0,0 +1,43 @@
|
||||
name: Use substrate and polkadot binaries
|
||||
description: Downloads and configures the substrate and polkadot binaries built with `build-nodes`
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: sudo apt-get update && sudo apt-get install -y curl gcc make clang cmake
|
||||
|
||||
- name: Download substrate-node binary
|
||||
id: download-substrate-binary
|
||||
uses: dawidd6/action-download-artifact@4c1e823582f43b179e2cbb49c3eade4e41f992e2 # v10
|
||||
with:
|
||||
workflow: build-nodes.yml
|
||||
name: nightly-substrate-binary
|
||||
|
||||
- name: Download polkadot binary
|
||||
id: download-polkadot-binary
|
||||
uses: dawidd6/action-download-artifact@4c1e823582f43b179e2cbb49c3eade4e41f992e2 # v10
|
||||
with:
|
||||
workflow: build-nodes.yml
|
||||
name: nightly-polkadot-binary
|
||||
|
||||
- name: decompress polkadot binary
|
||||
shell: bash
|
||||
run: |
|
||||
tar -xzvf ./polkadot.tar.gz
|
||||
cp ./target/release/polkadot ./polkadot
|
||||
|
||||
- name: Prepare binaries
|
||||
shell: bash
|
||||
run: |
|
||||
chmod u+x ./substrate-node
|
||||
chmod u+x ./polkadot
|
||||
chmod u+x ./polkadot-execute-worker
|
||||
chmod u+x ./polkadot-prepare-worker
|
||||
./substrate-node --version
|
||||
./polkadot --version
|
||||
sudo mv ./substrate-node /usr/local/bin
|
||||
sudo mv ./polkadot /usr/local/bin
|
||||
sudo mv ./polkadot-execute-worker /usr/local/bin
|
||||
sudo mv ./polkadot-prepare-worker /usr/local/bin
|
||||
rm ./polkadot.tar.gz
|
||||
@@ -0,0 +1,73 @@
|
||||
name: Build Substrate and Polkadot Binaries
|
||||
|
||||
on:
|
||||
# Allow it to be manually ran to rebuild binary when needed:
|
||||
workflow_dispatch: {}
|
||||
# Run at 2am every day for nightly builds.
|
||||
schedule:
|
||||
- cron: "0 2 * * *"
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: Build Substrate and Polkadot Binaries
|
||||
runs-on: parity-large
|
||||
steps:
|
||||
- name: checkout polkadot-sdk
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: paritytech/polkadot-sdk
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler curl gcc make clang cmake llvm-dev libclang-dev
|
||||
|
||||
- name: Install Rust v1.88 toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: 1.88
|
||||
components: rust-src
|
||||
target: wasm32-unknown-unknown
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
||||
|
||||
- name: build substrate binary
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --release --manifest-path substrate/bin/node/cli/Cargo.toml
|
||||
|
||||
- name: build polkadot binary
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --release --manifest-path polkadot/Cargo.toml
|
||||
|
||||
- name: Strip binaries
|
||||
run: |
|
||||
cargo install cargo-strip
|
||||
cargo strip
|
||||
|
||||
- name: upload substrate binary
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: nightly-substrate-binary
|
||||
path: target/release/substrate-node
|
||||
retention-days: 2
|
||||
if-no-files-found: error
|
||||
|
||||
# Note: Uncompressed polkadot binary is ~124MB -> too large for git (max 100MB) without git lfs. Compressed it is only ~45MB
|
||||
- name: compress polkadot binary
|
||||
run: |
|
||||
tar -zcvf target/release/polkadot.tar.gz target/release/polkadot
|
||||
|
||||
- name: upload polkadot binary
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: nightly-polkadot-binary
|
||||
path: |
|
||||
target/release/polkadot.tar.gz
|
||||
target/release/polkadot-execute-worker
|
||||
target/release/polkadot-prepare-worker
|
||||
retention-days: 2
|
||||
if-no-files-found: error
|
||||
@@ -0,0 +1,51 @@
|
||||
name: Daily compatibility check against latest substrate
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Run at 8am every day, well after the new binary is built
|
||||
- cron: "0 8 * * *"
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: Cargo test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Use substrate and polkadot node binaries
|
||||
uses: ./.github/workflows/actions/use-nodes
|
||||
|
||||
- name: Install Rust stable toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
||||
|
||||
- name: Cargo test
|
||||
uses: actions-rs/cargo@v1.0.3
|
||||
with:
|
||||
command: test
|
||||
args: --all-targets --workspace
|
||||
|
||||
# If any previous step fails, create a new Github issue to notify us about it.
|
||||
- if: ${{ failure() }}
|
||||
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
# Use this issue template:
|
||||
filename: .github/issue_templates/nightly_run_failed.md
|
||||
# Update existing issue if found; hopefully will make it clearer
|
||||
# that it is still an issue:
|
||||
update_existing: true
|
||||
# Look for new *open* issues in this search (we want to
|
||||
# create a new one if we only find closed versions):
|
||||
search_existing: open
|
||||
@@ -0,0 +1,529 @@
|
||||
name: Rust
|
||||
|
||||
on:
|
||||
push:
|
||||
# Run jobs when commits are pushed to
|
||||
# master or release-like branches:
|
||||
branches:
|
||||
- master
|
||||
# If we want to backport changes to an old release, push a branch
|
||||
# eg v0.40.x and CI will run on it. PRs merging to such branches
|
||||
# will also trigger CI.
|
||||
- v0.[0-9]+.x
|
||||
pull_request:
|
||||
# Run jobs for any external PR that wants
|
||||
# to merge to master, too:
|
||||
branches:
|
||||
- master
|
||||
- v0.[0-9]+.x
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
# Increase wasm test timeout from 20 seconds (default) to 1 minute.
|
||||
WASM_BINDGEN_TEST_TIMEOUT: 60
|
||||
|
||||
jobs:
|
||||
fmt:
|
||||
name: Cargo fmt
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Rust nightly toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
||||
|
||||
- name: Cargo fmt
|
||||
uses: actions-rs/cargo@v1.0.3
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
|
||||
- if: "failure()"
|
||||
uses: "andymckay/cancel-action@a955d435292c0d409d104b57d8e78435a93a6ef1" # v0.5
|
||||
|
||||
machete:
|
||||
name: "Check unused dependencies"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Use substrate and polkadot node binaries
|
||||
uses: ./.github/workflows/actions/use-nodes
|
||||
|
||||
- name: Install Rust stable toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
||||
|
||||
- name: Install cargo-machete
|
||||
run: cargo install cargo-machete
|
||||
|
||||
- name: Check unused dependencies
|
||||
uses: actions-rs/cargo@v1.0.3
|
||||
with:
|
||||
command: machete
|
||||
|
||||
- if: "failure()"
|
||||
uses: "andymckay/cancel-action@a955d435292c0d409d104b57d8e78435a93a6ef1" # v0.5
|
||||
|
||||
clippy:
|
||||
name: Cargo clippy
|
||||
runs-on: parity-large
|
||||
needs: [fmt, machete]
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Use substrate and polkadot node binaries
|
||||
uses: ./.github/workflows/actions/use-nodes
|
||||
|
||||
- name: Install Rust stable toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
components: clippy
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
||||
|
||||
- name: Run clippy
|
||||
run: |
|
||||
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 --no-default-features --features web -- -D warnings
|
||||
cargo clippy -p subxt --no-default-features --features web,unstable-light-client -- -D warnings
|
||||
|
||||
- if: "failure()"
|
||||
uses: "andymckay/cancel-action@a955d435292c0d409d104b57d8e78435a93a6ef1" # v0.5
|
||||
|
||||
wasm_clippy:
|
||||
name: Cargo clippy (WASM)
|
||||
runs-on: ubuntu-latest
|
||||
needs: [fmt, machete]
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Use substrate and polkadot node binaries
|
||||
uses: ./.github/workflows/actions/use-nodes
|
||||
|
||||
- name: Install Rust stable toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
target: wasm32-unknown-unknown
|
||||
override: true
|
||||
components: clippy
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
||||
|
||||
- name: Run clippy
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: clippy
|
||||
args: -p subxt --no-default-features --features web,unstable-light-client,jsonrpsee --target wasm32-unknown-unknown -- -D warnings
|
||||
|
||||
- if: "failure()"
|
||||
uses: "andymckay/cancel-action@a955d435292c0d409d104b57d8e78435a93a6ef1" # v0.5
|
||||
|
||||
check:
|
||||
name: Cargo check
|
||||
runs-on: parity-large
|
||||
needs: [fmt, machete]
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Use substrate and polkadot node binaries
|
||||
uses: ./.github/workflows/actions/use-nodes
|
||||
|
||||
- name: Install Rust stable toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
||||
|
||||
- name: Install cargo-hack
|
||||
uses: baptiste0928/cargo-install@v3
|
||||
with:
|
||||
crate: cargo-hack
|
||||
version: 0.5
|
||||
|
||||
# A basic check over all targets together. This may lead to features being combined etc,
|
||||
# and doesn't test combinations of different features.
|
||||
- name: Cargo check all targets.
|
||||
run: cargo check --all-targets
|
||||
|
||||
# Next, check each subxt feature in isolation.
|
||||
# - `native` feature must always be enabled
|
||||
# - `web` feature is always ignored.
|
||||
- name: Cargo hack; check each subxt feature
|
||||
run: cargo hack -p subxt --each-feature check --exclude-features web --features native
|
||||
|
||||
# Same with subxt-historic
|
||||
- name: Cargo hack; check each subxt feature
|
||||
run: cargo hack -p subxt-historic --each-feature check --exclude-features web --features native
|
||||
|
||||
# And with subxt-rpcs
|
||||
- name: Cargo hack; check each subxt-rpcs feature
|
||||
run: cargo hack -p subxt-rpcs --each-feature check --exclude-features web --features native
|
||||
|
||||
# And with subxt-signer (seems to work with a more basic check here; disable web if it becomes an issue).
|
||||
- name: Cargo hack; check each subxt-signer feature
|
||||
run: cargo hack -p subxt-signer --each-feature check
|
||||
|
||||
# And for subxt-lightclient.
|
||||
- name: Cargo check subxt-lightclient
|
||||
run: cargo hack -p subxt-lightclient --each-feature check --exclude-features web --features native
|
||||
|
||||
# Next, check all other crates.
|
||||
- name: Cargo hack; check each feature/crate on its own
|
||||
run: cargo hack --exclude subxt --exclude subxt-historic --exclude subxt-signer --exclude subxt-lightclient --exclude subxt-rpcs --exclude-all-features --each-feature check --workspace
|
||||
|
||||
# Check the full examples, which aren't a part of the workspace so are otherwise ignored.
|
||||
- name: Cargo check parachain-example
|
||||
run: cargo check --manifest-path examples/parachain-example/Cargo.toml
|
||||
- name: Cargo check ffi-example
|
||||
run: cargo check --manifest-path examples/ffi-example/Cargo.toml
|
||||
|
||||
- if: "failure()"
|
||||
uses: "andymckay/cancel-action@a955d435292c0d409d104b57d8e78435a93a6ef1" # v0.5
|
||||
|
||||
ffi_example:
|
||||
name: Run FFI Example
|
||||
runs-on: ubuntu-latest
|
||||
needs: [check]
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Use substrate and polkadot node binaries
|
||||
uses: ./.github/workflows/actions/use-nodes
|
||||
|
||||
- name: Install Rust stable toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
target: wasm32-unknown-unknown
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
||||
|
||||
- name: Install
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
# Node version 20 and higher seem to cause an issue with the JS example so stick to 19 for now.
|
||||
node-version: 19.x
|
||||
|
||||
- name: Cargo check/run ffi-example
|
||||
run: |
|
||||
# Start node on port 8000
|
||||
substrate-node --dev --rpc-port 8000 > /dev/null 2>&1 &
|
||||
|
||||
# Build the Rust code (hopefully gives long enough for substrate server to start, too):
|
||||
cd examples/ffi-example
|
||||
cargo build
|
||||
|
||||
# Run the python version of the FFI code:
|
||||
echo "Running Python FFI example..."
|
||||
python3 src/main.py
|
||||
echo "Python FFI example completed with exit code $?"
|
||||
|
||||
# Run the node version of the FFI code
|
||||
echo "Installing Node.js dependencies..."
|
||||
npm i
|
||||
echo "Running Node FFI example..."
|
||||
node src/main.js
|
||||
echo "Node FFI example completed with exit code $?"
|
||||
|
||||
pkill substrate-node
|
||||
|
||||
wasm_check:
|
||||
name: Cargo check (WASM)
|
||||
runs-on: ubuntu-latest
|
||||
needs: [fmt, machete]
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Rust stable toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
target: wasm32-unknown-unknown
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
||||
|
||||
- name: Cargo check web features which require wasm32 target.
|
||||
run: |
|
||||
cargo check -p subxt-rpcs --target wasm32-unknown-unknown --no-default-features --features web
|
||||
cargo check -p subxt-rpcs --target wasm32-unknown-unknown --no-default-features --features web,reconnecting-rpc-client
|
||||
|
||||
# Check WASM examples, which aren't a part of the workspace and so are otherwise missed:
|
||||
- name: Cargo check WASM examples
|
||||
run: |
|
||||
cargo check --manifest-path examples/wasm-example/Cargo.toml --target wasm32-unknown-unknown
|
||||
|
||||
- if: "failure()"
|
||||
uses: "andymckay/cancel-action@a955d435292c0d409d104b57d8e78435a93a6ef1" # v0.5
|
||||
|
||||
docs:
|
||||
name: Check documentation and run doc tests
|
||||
runs-on: parity-large
|
||||
needs: [fmt, machete]
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Use substrate and polkadot node binaries
|
||||
uses: ./.github/workflows/actions/use-nodes
|
||||
|
||||
- name: Install Rust stable toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
||||
|
||||
- name: Check internal documentation links
|
||||
run: RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --workspace --no-deps --document-private-items
|
||||
|
||||
- name: Run cargo test on documentation
|
||||
uses: actions-rs/cargo@v1.0.3
|
||||
with:
|
||||
command: test
|
||||
args: --doc --features reconnecting-rpc-client
|
||||
|
||||
- if: "failure()"
|
||||
uses: "andymckay/cancel-action@a955d435292c0d409d104b57d8e78435a93a6ef1" # v0.5
|
||||
|
||||
tests:
|
||||
name: "Test (Native)"
|
||||
runs-on: parity-large
|
||||
needs: [clippy, wasm_clippy, check, wasm_check, docs]
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Use substrate and polkadot node binaries
|
||||
uses: ./.github/workflows/actions/use-nodes
|
||||
|
||||
- name: Install Rust stable toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
||||
|
||||
- name: Install cargo-nextest
|
||||
run: cargo install cargo-nextest
|
||||
|
||||
- name: Run subxt-signer no-std tests
|
||||
uses: actions-rs/cargo@v1.0.3
|
||||
with:
|
||||
command: test
|
||||
working-directory: signer/tests/no-std
|
||||
|
||||
- name: Run tests
|
||||
uses: actions-rs/cargo@v1.0.3
|
||||
with:
|
||||
command: nextest
|
||||
args: run --workspace --features reconnecting-rpc-client
|
||||
|
||||
- if: "failure()"
|
||||
uses: "andymckay/cancel-action@a955d435292c0d409d104b57d8e78435a93a6ef1" # v0.5
|
||||
|
||||
unstable_backend_tests:
|
||||
name: "Test chainhead backend"
|
||||
runs-on: parity-large
|
||||
needs: [clippy, wasm_clippy, check, wasm_check, docs]
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Use substrate and polkadot node binaries
|
||||
uses: ./.github/workflows/actions/use-nodes
|
||||
|
||||
- name: Install Rust stable toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
||||
|
||||
- name: Install cargo-nextest
|
||||
run: cargo install cargo-nextest
|
||||
|
||||
- name: Run tests
|
||||
uses: actions-rs/cargo@v1.0.3
|
||||
with:
|
||||
command: nextest
|
||||
args: run --workspace --features chainhead-backend
|
||||
|
||||
- if: "failure()"
|
||||
uses: "andymckay/cancel-action@a955d435292c0d409d104b57d8e78435a93a6ef1" # v0.5
|
||||
|
||||
light_client_tests:
|
||||
name: "Test (Light Client)"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [clippy, wasm_clippy, check, wasm_check, docs]
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Use substrate and polkadot node binaries
|
||||
uses: ./.github/workflows/actions/use-nodes
|
||||
|
||||
- name: Install Rust stable toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
||||
|
||||
- name: Run tests
|
||||
uses: actions-rs/cargo@v1.0.3
|
||||
with:
|
||||
command: test
|
||||
args: --release --package integration-tests --features unstable-light-client
|
||||
|
||||
- if: "failure()"
|
||||
uses: "andymckay/cancel-action@a955d435292c0d409d104b57d8e78435a93a6ef1" # v0.5
|
||||
|
||||
wasm_tests:
|
||||
name: Test (WASM)
|
||||
runs-on: ubuntu-latest
|
||||
needs: [clippy, wasm_clippy, check, wasm_check, docs]
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
# Set timeout for wasm tests to be much bigger than the default 20 secs.
|
||||
WASM_BINDGEN_TEST_TIMEOUT: 300
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install wasm-pack
|
||||
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||
|
||||
- name: Install firefox
|
||||
uses: browser-actions/setup-firefox@latest
|
||||
|
||||
- name: Install chrome
|
||||
uses: browser-actions/setup-chrome@latest
|
||||
|
||||
- name: Use substrate and polkadot node binaries
|
||||
uses: ./.github/workflows/actions/use-nodes
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
||||
|
||||
- name: Run subxt WASM tests
|
||||
run: |
|
||||
# `listen-addr` is used to configure p2p to accept websocket connections instead of TCP.
|
||||
# `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 &
|
||||
wasm-pack test --headless --firefox
|
||||
wasm-pack test --headless --chrome
|
||||
pkill substrate-node
|
||||
working-directory: testing/wasm-rpc-tests
|
||||
|
||||
- name: Run subxt-lightclient WASM tests
|
||||
run: |
|
||||
# `listen-addr` is used to configure p2p to accept websocket connections instead of TCP.
|
||||
# `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 &
|
||||
wasm-pack test --headless --firefox
|
||||
wasm-pack test --headless --chrome
|
||||
pkill substrate-node
|
||||
working-directory: testing/wasm-lightclient-tests
|
||||
|
||||
- name: Run subxt-signer WASM tests
|
||||
run: |
|
||||
wasm-pack test --headless --firefox
|
||||
wasm-pack test --headless --chrome
|
||||
working-directory: signer/tests/wasm
|
||||
|
||||
- if: "failure()"
|
||||
uses: "andymckay/cancel-action@a955d435292c0d409d104b57d8e78435a93a6ef1" # v0.5
|
||||
|
||||
no-std-tests:
|
||||
name: "Test (no_std)"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [machete, docs]
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v6
|
||||
|
||||
# Note: needs nighly toolchain because otherwise we cannot define custom lang-items.
|
||||
- name: Install Rust nightly toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
override: true
|
||||
target: thumbv7em-none-eabi
|
||||
|
||||
- name: Install the gcc-arm-none-eabi linker
|
||||
run: sudo apt install gcc-arm-none-eabi
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
||||
|
||||
# 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.
|
||||
# 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.
|
||||
run: cargo build --target thumbv7em-none-eabi
|
||||
working-directory: testing/no-std-tests
|
||||
|
||||
- if: "failure()"
|
||||
uses: "andymckay/cancel-action@a955d435292c0d409d104b57d8e78435a93a6ef1" # v0.5
|
||||
@@ -0,0 +1,62 @@
|
||||
name: Update Artifacts
|
||||
|
||||
on:
|
||||
workflow_dispatch: # Allows manual triggering
|
||||
schedule:
|
||||
- cron: "0 0 * * 1" # weekly on Monday at 00:00 UTC
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: Renew Artifacts
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v6
|
||||
# We run this (up-to-date) node locally to fetch metadata from it for the artifacts
|
||||
- name: Use substrate and polkadot node binaries
|
||||
uses: ./.github/workflows/actions/use-nodes
|
||||
|
||||
- name: Install Rust stable toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
|
||||
|
||||
# This starts a substrate node and runs a few subxt cli child processes to fetch metadata from it and generate code.
|
||||
# In particular it generates:
|
||||
# - 4 metadata (*.scale) files in the `artifacts` directory
|
||||
# - a polkadot.rs file from the full metadata that is checked in integration tests
|
||||
# - a polkadot.json in the `artifacts/demo_chain_specs` directory
|
||||
- name: Fetch Artifacts
|
||||
run: cargo run --bin artifacts
|
||||
|
||||
- uses: actions/create-github-app-token@v2
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ secrets.SUBXT_PR_MAKER_APP_ID }}
|
||||
private-key: ${{ secrets.SUBXT_PR_MAKER_APP_KEY }}
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
with:
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
base: master
|
||||
branch: update-artifacts
|
||||
commit-message: Update Artifacts (auto-generated)
|
||||
branch-suffix: timestamp
|
||||
title: Update Artifacts (auto-generated)
|
||||
body: |
|
||||
This PR updates the artifacts by fetching fresh metadata from a substrate node.
|
||||
It also recreates the polkadot.rs file used in the integration tests.
|
||||
It was created automatically by a Weekly GitHub Action Cronjob.
|
||||
@@ -0,0 +1,14 @@
|
||||
name: Dependabot
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/dependabot.yml'
|
||||
- '.github/workflows/validate-dependabot.yml'
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: marocchino/validate-dependabot@v3
|
||||
id: validate
|
||||
Reference in New Issue
Block a user