Skip to content

Commit a1f791f

Browse files
authored
Merge branch 'libp2p:master' into master
2 parents 91f9faf + ab7b5a4 commit a1f791f

File tree

343 files changed

+54112
-19718
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

343 files changed

+54112
-19718
lines changed

.cargo/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[alias]
2+
# Temporary solution to have clippy config in a single place until https://github.com/rust-lang/rust-clippy/blob/master/doc/roadmap-2021.md#lintstoml-configuration is shipped.
3+
custom-clippy = "clippy -- -A clippy::type_complexity -A clippy::pedantic -A clippy::style -D warnings"

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "cargo"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
open-pull-requests-limit: 9999
8+
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
# Check for updates to GitHub Actions every weekday
13+
interval: "daily"

.github/workflows/ci.yml

Lines changed: 118 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -9,107 +9,158 @@ on:
99
jobs:
1010
test-desktop:
1111
name: Build and test
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-18.04
13+
strategy:
14+
matrix:
15+
args: [
16+
"--no-default-features",
17+
"--all-features",
18+
"--benches --all-features",
19+
]
1320
steps:
14-
- uses: actions/checkout@v1
15-
- name: Cache cargo registry
16-
uses: actions/cache@v1
17-
with:
18-
path: ~/.cargo/registry
19-
key: cargo-registry-${{ hashFiles('Cargo.toml') }}
20-
- name: Cache cargo index
21-
uses: actions/cache@v1
21+
22+
- name: Cancel Previous Runs
23+
uses: styfle/[email protected]
2224
with:
23-
path: ~/.cargo/git
24-
key: cargo-index-${{ hashFiles('Cargo.toml') }}
25-
- name: Cache cargo build
26-
uses: actions/cache@v1
25+
access_token: ${{ github.token }}
26+
27+
- uses: actions/[email protected]
28+
29+
- uses: Swatinem/[email protected]
2730
with:
28-
path: target
29-
key: cargo-build-target-${{ hashFiles('Cargo.toml') }}
30-
- name: Run tests, with no feature
31-
run: cargo test --workspace --no-default-features
32-
- name: Run tests, with all features
33-
run: cargo test --workspace --all-features
31+
key: ${{ matrix.args }}
32+
33+
- run: cargo test --workspace ${{ matrix.args }}
3434

3535
test-wasm:
3636
name: Build on WASM
37-
runs-on: ubuntu-latest
37+
runs-on: ubuntu-18.04
38+
strategy:
39+
matrix:
40+
toolchain: [
41+
wasm32-unknown-emscripten,
42+
wasm32-wasi
43+
]
44+
include:
45+
- toolchain: wasm32-unknown-unknown
46+
args: "--features wasm-bindgen"
3847
container:
3948
image: rust
4049
env:
41-
CC: clang-10
50+
CC: clang-11
4251
steps:
43-
- uses: actions/checkout@v1
44-
- name: Install Rust
45-
uses: actions-rs/toolchain@v1
52+
53+
- name: Cancel Previous Runs
54+
uses: styfle/[email protected]
55+
with:
56+
access_token: ${{ github.token }}
57+
58+
- uses: actions/[email protected]
59+
60+
- name: Install Rust ${{ matrix.toolchain }}
61+
uses: actions-rs/[email protected]
4662
with:
4763
toolchain: stable
48-
target: wasm32-unknown-unknown
64+
target: ${{ matrix.toolchain }}
4965
override: true
66+
5067
- name: Install a recent version of clang
5168
run: |
52-
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
53-
echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main" >> /etc/apt/sources.list
5469
apt-get update
55-
apt-get install -y clang-10
70+
apt-get install -y clang-11
71+
5672
- name: Install CMake
5773
run: apt-get install -y cmake
58-
- name: Cache cargo registry
59-
uses: actions/cache@v1
60-
with:
61-
path: ~/.cargo/registry
62-
key: wasm-cargo-registry-${{ hashFiles('Cargo.toml') }}
63-
- name: Cache cargo index
64-
uses: actions/cache@v1
65-
with:
66-
path: ~/.cargo/git
67-
key: wasm-cargo-index-${{ hashFiles('Cargo.toml') }}
68-
- name: Cache cargo build
69-
uses: actions/cache@v1
74+
75+
- uses: Swatinem/[email protected]
7076
with:
71-
path: target
72-
key: wasm-cargo-build-target-${{ hashFiles('Cargo.toml') }}
73-
- name: Build on WASM
77+
key: ${{ matrix.toolchain }}
78+
79+
- name: Build on ${{ matrix.toolchain }}
7480
# TODO: also run `cargo test`
7581
# TODO: ideally we would build `--workspace`, but not all crates compile for WASM
76-
run: cargo build --target=wasm32-unknown-unknown
82+
run: cargo build --target=${{ matrix.toolchain }} ${{ matrix.args }}
7783

7884
check-rustdoc-links:
7985
name: Check rustdoc intra-doc links
80-
runs-on: ubuntu-latest
86+
runs-on: ubuntu-18.04
8187
container:
8288
image: rust
8389
steps:
84-
- uses: actions/checkout@v1
85-
- name: Install nightly Rust
86-
# TODO: intra-doc links are available on nightly only
87-
# see https://doc.rust-lang.org/nightly/rustdoc/lints.html#intra_doc_link_resolution_failure
88-
run: rustup default nightly-2020-05-20
90+
91+
- name: Cancel Previous Runs
92+
uses: styfle/[email protected]
93+
with:
94+
access_token: ${{ github.token }}
95+
96+
- uses: actions/[email protected]
97+
98+
- uses: Swatinem/[email protected]
99+
89100
- name: Check rustdoc links
90-
run: RUSTDOCFLAGS="--deny intra_doc_link_resolution_failure" cargo doc --verbose --workspace --no-deps --document-private-items
101+
run: RUSTDOCFLAGS="--deny broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items
102+
103+
check-clippy:
104+
runs-on: ubuntu-18.04
105+
steps:
106+
107+
- name: Cancel Previous Runs
108+
uses: styfle/[email protected]
109+
with:
110+
access_token: ${{ github.token }}
111+
112+
- uses: actions/[email protected]
113+
114+
- uses: actions-rs/[email protected]
115+
with:
116+
profile: minimal
117+
toolchain: stable
118+
override: true
119+
components: clippy
120+
121+
- uses: Swatinem/[email protected]
122+
123+
- name: Run cargo clippy
124+
uses: actions-rs/[email protected]
125+
with:
126+
command: custom-clippy # cargo alias to allow reuse of config locally
91127

92128
integration-test:
93129
name: Integration tests
94-
runs-on: ubuntu-latest
130+
runs-on: ubuntu-18.04
95131
container:
96132
image: rust
97133
steps:
98-
- uses: actions/checkout@v1
99-
- name: Cache cargo registry
100-
uses: actions/cache@v1
101-
with:
102-
path: ~/.cargo/registry
103-
key: cargo-registry-${{ hashFiles('Cargo.toml') }}
104-
- name: Cache cargo index
105-
uses: actions/cache@v1
106-
with:
107-
path: ~/.cargo/git
108-
key: cargo-index-${{ hashFiles('Cargo.toml') }}
109-
- name: Cache cargo build
110-
uses: actions/cache@v1
134+
135+
- name: Cancel Previous Runs
136+
uses: styfle/[email protected]
111137
with:
112-
path: target
113-
key: cargo-build-target-${{ hashFiles('Cargo.toml') }}
138+
access_token: ${{ github.token }}
139+
140+
- uses: actions/[email protected]
141+
142+
- uses: Swatinem/[email protected]
143+
114144
- name: Run ipfs-kad example
115145
run: RUST_LOG=libp2p_swarm=debug,libp2p_kad=trace,libp2p_tcp=debug cargo run --example ipfs-kad
146+
147+
rustfmt:
148+
runs-on: ubuntu-18.04
149+
steps:
150+
151+
- name: Cancel Previous Runs
152+
uses: styfle/[email protected]
153+
with:
154+
access_token: ${{ github.token }}
155+
156+
- uses: actions/[email protected]
157+
158+
- uses: actions-rs/[email protected]
159+
with:
160+
profile: minimal
161+
toolchain: stable
162+
override: true
163+
components: rustfmt
164+
165+
- name: Check formatting
166+
run: cargo fmt -- --check

0 commit comments

Comments
 (0)