Skip to content

Commit

Permalink
libp2p get providers and handle peer requests for records (#185)
Browse files Browse the repository at this point in the history
Includes:

* cargo docs pre-commit and ci
* more event / record handling
* backs up to provider if get_record (via put) fails
  • Loading branch information
Zeeshan Lakhani authored Jul 10, 2023
1 parent 307d234 commit 0b39147
Show file tree
Hide file tree
Showing 29 changed files with 1,129 additions and 1,799 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout Repository
uses: actions/checkout@v3

Expand Down
21 changes: 6 additions & 15 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout Repository
uses: actions/checkout@v3

- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: nightly
components: llvm-tools-preview
profile: minimal
id: toolchain
uses: dtolnay/rust-toolchain@nightly

- name: Override rust-toolchain.toml
run: rustup override set ${{steps.toolchain.outputs.name}}

- name: Cache Project
uses: Swatinem/rust-cache@v2
Expand All @@ -51,10 +45,7 @@ jobs:
run: "./grcov . --llvm --binary-path target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' -o lcov.info"

- name: Install covfix
uses: actions-rs/[email protected]
with:
crate: rust-covfix
use-tool-cache: true
run: cargo install --force rust-covfix

- name: Run covfix
run: rust-covfix lcov.info -o lcov.info --verbose
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ jobs:
strategy:
fail-fast: false
steps:
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout Repository
uses: actions/checkout@v3

Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,14 @@ jobs:
uses: Swatinem/rust-cache@v2

- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
override: true
profile: minimal
toolchain: stable
uses: dtolnay/rust-toolchain@stable

- name: Install Cargo Workspaces
env:
RUSTFLAGS: '-Copt-level=1'
uses: actions-rs/cargo@v1
uses: dtolnay/install@master
with:
args: --force cargo-workspaces
command: install
crate: cargo-workspaces

- name: Verify Publishing of crates
uses: katyo/publish-crates@v2
Expand Down
80 changes: 37 additions & 43 deletions .github/workflows/tests_and_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ jobs:
# minimum version
- 1.66
steps:
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout Repository
uses: actions/checkout@v3

Expand All @@ -36,28 +31,21 @@ jobs:
- name: Cache Project
uses: Swatinem/rust-cache@v2

# Widely adopted suite of Rust-specific boilerplate actions, especially
# toolchain/cargo use: https://actions-rs.github.io/
- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
id: toolchain
uses: dtolnay/rust-toolchain@master
with:
override: true
components: rustfmt, clippy
toolchain: ${{ matrix.rust-toolchain }}

- name: Override rust-toolchain.toml
run: rustup override set ${{steps.toolchain.outputs.name}}

- name: Check Format
uses: actions-rs/cargo@v1
with:
args: --all -- --check
command: fmt
toolchain: ${{ matrix.rust-toolchain }}
run: cargo fmt --all -- --check

- name: Run Linter
uses: actions-rs/cargo@v1
with:
args: --all -- -D warnings
command: clippy
toolchain: ${{ matrix.rust-toolchain }}
run: cargo clippy --all -- -D warnings

# Check for security advisories
- name: Check Advisories
Expand Down Expand Up @@ -88,28 +76,21 @@ jobs:
- stable
- nightly
steps:
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout Repository
uses: actions/checkout@v3

- name: Install Environment Packages
run: |
sudo apt-get update -qqy
sudo apt-get install jq
- name: Cache Project
uses: Swatinem/rust-cache@v2

- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
id: toolchain
uses: dtolnay/rust-toolchain@master
with:
override: true
toolchain: ${{ matrix.rust-toolchain }}

- name: Override rust-toolchain.toml
run: rustup override set ${{steps.toolchain.outputs.name}}

- name: Install nextest
uses: taiki-e/install-action@nextest

Expand All @@ -128,30 +109,43 @@ jobs:
- stable
- nightly
steps:
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout Repository
uses: actions/checkout@v3

- name: Install Environment Packages
run: |
sudo apt-get update -qqy
sudo apt-get install jq
- name: Cache Project
uses: Swatinem/rust-cache@v2

- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
id: toolchain
uses: dtolnay/rust-toolchain@master
with:
override: true
toolchain: ${{ matrix.rust-toolchain }}

- name: Override rust-toolchain.toml
run: rustup override set ${{steps.toolchain.outputs.name}}

- name: Install nextest
uses: taiki-e/install-action@nextest

- name: Run Tests
run: cargo nextest run --no-default-features

run-docs:
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Cache Project
uses: Swatinem/rust-cache@v2

- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable

- name: Run Doc(s) compilation
env:
RUSTDOCFLAGS: -Dwarnings
run: cargo doc --document-private-items
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ repos:
args: ["--workspace", "--", "-D", "warnings"]
types: [rust]
pass_filenames: false
- id: docs
name: docs
description: Check docs for warnings.
entry: env RUSTDOCFLAGS=-Dwarnings cargo doc
language: system
args: ["--document-private-items"]
types: [rust]
pass_filenames: false
- id: alejandra
name: alejandra
description: Format nix files.
Expand Down
Loading

0 comments on commit 0b39147

Please sign in to comment.