Upgrade libp2p to version 0.53.1 #10838
This file contains 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: Build + Test | |
on: | |
push: | |
branches: | |
- albatross | |
- testnet | |
pull_request: | |
merge_group: | |
workflow_dispatch: | |
jobs: | |
rustfmt: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly | |
components: rustfmt | |
- run: cargo fmt --all -- --check | |
test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
# this might remove tools that are actually needed, | |
# if set to "true" but frees about 6 GB | |
tool-cache: true | |
# all of these default to true, but feel free to set to | |
# "false" if necessary for your workflow | |
android: true | |
dotnet: true | |
haskell: true | |
large-packages: false | |
swap-storage: true | |
- uses: actions/checkout@v4 | |
- name: "Check for duplicate message IDs" | |
run: "! grep -rEoh --exclude-dir tests --exclude-dir target 'TYPE_ID: u16 = [^;]+;' | sort | uniq -d | grep '^'" | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
components: llvm-tools-preview | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install Protoc | |
run: sudo apt-get install protobuf-compiler | |
- name: Install cargo-nextest | |
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin | |
# Coverage is disabled for now since at the moment it has a considerable performance impact in the CI | |
#- name: Install cargo-llvm-cov | |
# run: cargo install cargo-llvm-cov | |
#- name: Remove possible stale artifacts | |
# run: cargo llvm-cov clean --workspace | |
#- name: Run test with coverage instrumentation | |
# run: cargo llvm-cov nextest --features=nimiq-zkp-component/test-prover | |
# Fixme: --doctest is not supported in stable. See: | |
# https://github.com/taiki-e/cargo-llvm-cov/tree/7448e48b438797efb446a98ebd8ff22d3fae5ebe#known-limitations | |
# run: cargo llvm-cov --features=nimiq-zkp-component/test-prover --doctests | |
#- name: Generate coverage report | |
# run: cargo llvm-cov report --lcov --output-path coverage.lcov | |
#- name: Upload coverage to Codecov | |
# uses: codecov/codecov-action@v3 | |
# with: | |
# files: coverage.lcov | |
# fail_ci_if_error: false | |
# flags: unittests | |
# name: Nimiq code coverage | |
# verbose: true | |
- name: Run tests | |
run: cargo nextest run --features=nimiq-zkp-component/test-prover | |
# Currently `nextest` doesn't support doctest so we have to run them apart | |
- name: Run doctest | |
run: cargo test --doc | |
clippy: | |
if: github.event_name != 'push' || github.event.pusher.name != 'dependabot[bot]' | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install Protoc | |
run: sudo apt-get install protobuf-compiler | |
- uses: actions-rs/clippy-check@v1 | |
with: | |
name: Clippy Report | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --release --all-features | |
web-client: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
# this might remove tools that are actually needed, | |
# if set to "true" but frees about 6 GB | |
tool-cache: true | |
# all of these default to true, but feel free to set to | |
# "false" if necessary for your workflow | |
android: true | |
dotnet: true | |
haskell: true | |
large-packages: false | |
swap-storage: true | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install Protoc | |
run: sudo apt-get install protobuf-compiler | |
- name: Install wasm-pack | |
run: cargo install wasm-pack | |
- name: Compile to wasm and generate bindings | |
working-directory: ./web-client | |
run: wasm-pack build --target web | |
- name: Execute wasm unittests | |
working-directory: ./web-client | |
run: wasm-pack test --node | |
reconnect-test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
- name: Install python dependencies | |
run: pip install scripts/devnet | |
- name: Set up Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install Protoc | |
run: sudo apt-get install protobuf-compiler | |
- name: Build the code | |
run: cargo build | |
- name: Executes the 4 validators reconnecting scenario | |
run: | | |
python3 scripts/devnet/devnet.py -t .github/devnet_topologies/four_validators.toml -r 1 | |
- name: Archive test results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: reconnect-test-logs | |
path: | | |
temp-logs/ |