Skip to content

Disallow duplicate connections between peers #5159

Disallow duplicate connections between peers

Disallow duplicate connections between peers #5159

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
# Daily cron job used to clear and rebuild cache (https://github.com/Swatinem/rust-cache/issues/181).
schedule:
- cron: '0 0 * * *'
# Limits workflow concurrency to only the latest commit in the PR.
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
remove-codeql: "true"
remove-docker-images: "true"
root-reserve-mb: "2048"
temp-reserve-mb: "2048"
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
- uses: Noelware/[email protected]
- uses: taiki-e/install-action@nextest
- name: Clear cache
if: github.event_name =='schedule'
run: |
cargo clean
rm -rf ~/.cargo/registry
rm -rf ~/.cargo/git
- name: Compile unit tests
# --build-jobs 1 as we are constantly OOMing during compilation.
run: cargo nextest run --all-targets --all-features --workspace --locked --no-run --timings --build-jobs 1
- name: Run unit tests
run: timeout 10m cargo nextest run --no-fail-fast --all-targets --all-features --workspace --locked
- name: Store timings
uses: actions/upload-artifact@v3
with:
name: timings
path: target/cargo-timings/
if-no-files-found: warn
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
- uses: Noelware/[email protected]
- name: Clear cache
if: github.event_name =='schedule'
run: |
cargo clean
rm -rf ~/.cargo/registry
rm -rf ~/.cargo/git
- run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings -D rust_2018_idioms
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
doc:
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
- uses: Noelware/[email protected]
- name: Clear cache
if: github.event_name =='schedule'
run: cargo clean
- run: cargo doc --no-deps --document-private-items
dep-sort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: baptiste0928/cargo-install@v2
with:
crate: cargo-sort
version: "^1.0.9"
- run: |
cargo sort --check --workspace
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: crate-ci/[email protected]
with:
files: .
load_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: cargo check
run: |
cd crates/load-test
cargo check