forked from libp2p/rust-libp2p
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'libp2p:master' into master
- Loading branch information
Showing
441 changed files
with
19,045 additions
and
13,765 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
blank_issues_enabled: true | ||
contact_links: | ||
- name: Question | ||
- name: Technical Questions | ||
url: https://github.com/libp2p/rust-libp2p/discussions/new?category=q-a | ||
about: Please ask questions in the rust-libp2p GitHub Discussions forum. | ||
- name: Libp2p Discourse Forum | ||
about: Please ask technical questions in the rust-libp2p GitHub Discussions forum. | ||
- name: Community-wide libp2p Discussion | ||
url: https://discuss.libp2p.io | ||
about: Discussions and questions related to multiple libp2p implementations. | ||
about: Discussions and questions about the libp2p community. |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,12 +33,14 @@ jobs: | |
CRATE: ${{ matrix.crate }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0 | ||
|
||
- uses: dtolnay/rust-toolchain@stable | ||
|
||
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | ||
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
shared-key: stable-cache | ||
save-if: false | ||
|
@@ -50,7 +52,7 @@ jobs: | |
run: cargo build --package "$CRATE" --no-default-features | ||
|
||
- name: Enforce no dependency on meta crate | ||
if: env.CRATE != 'libp2p-server' | ||
if: env.CRATE != 'libp2p-server' && env.CRATE != 'libp2p-perf' | ||
run: | | ||
cargo metadata --format-version=1 --no-deps | \ | ||
jq -e -r '.packages[] | select(.name == "'"$CRATE"'") | .dependencies | all(.name != "libp2p")' | ||
|
@@ -59,16 +61,48 @@ jobs: | |
with: | ||
tool: tomlq | ||
|
||
- name: Extract version from manifest | ||
run: | | ||
CRATE_VERSION=$(cargo metadata --format-version=1 --no-deps | jq -e -r '.packages[] | select(.name == "'"$CRATE"'") | .version') | ||
echo "CRATE_VERSION=$CRATE_VERSION" >> $GITHUB_ENV | ||
- name: Enforce version in `workspace.dependencies` matches latest version | ||
if: env.CRATE != 'libp2p' | ||
run: | | ||
PACKAGE_VERSION=$(cargo metadata --format-version=1 --no-deps | jq -e -r '.packages[] | select(.name == "'"$CRATE"'") | .version') | ||
SPECIFIED_VERSION=$(tomlq "workspace.dependencies.$CRATE.version" --file ./Cargo.toml) | ||
echo "Package version: $PACKAGE_VERSION"; | ||
echo "Package version: $CRATE_VERSION"; | ||
echo "Specified version: $SPECIFIED_VERSION"; | ||
test "$PACKAGE_VERSION" = "$SPECIFIED_VERSION" | ||
test "$CRATE_VERSION" = "$SPECIFIED_VERSION" || test "=$CRATE_VERSION" = "$SPECIFIED_VERSION" | ||
- name: Enforce version in CHANGELOG.md matches version in manifest | ||
run: | | ||
MANIFEST_PATH=$(cargo metadata --format-version=1 --no-deps | jq -e -r '.packages[] | select(.name == "'"$CRATE"'") | .manifest_path') | ||
DIR_TO_CRATE=$(dirname "$MANIFEST_PATH") | ||
VERSION_IN_CHANGELOG=$(awk -F' ' '/^## [0-9]+\.[0-9]+\.[0-9]+/{print $2; exit}' "$DIR_TO_CRATE/CHANGELOG.md") | ||
echo "Package version: $CRATE_VERSION"; | ||
echo "Changelog version: $VERSION_IN_CHANGELOG"; | ||
test "$CRATE_VERSION" = "$VERSION_IN_CHANGELOG" | ||
- name: Ensure manifest and CHANGELOG are properly updated | ||
if: > | ||
github.event_name == 'pull_request' && | ||
!startsWith(github.event.pull_request.title, 'chore') && | ||
!startsWith(github.event.pull_request.title, 'refactor') && | ||
!startsWith(github.event.pull_request.title, 'deps') && | ||
!startsWith(github.event.pull_request.title, 'docs') && | ||
!contains(github.event.pull_request.labels.*.name, 'internal-change') | ||
run: | | ||
git fetch origin master:master | ||
git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }} | ||
./scripts/ensure-version-bump-and-changelog.sh | ||
env: | ||
HEAD_SHA: ${{ github.event.pull_request.head.sha }} | ||
PR_BASE: ${{ github.event.pull_request.base.ref }} | ||
|
||
wasm_tests: | ||
name: Run all WASM tests | ||
|
@@ -124,7 +158,7 @@ jobs: | |
|
||
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0 | ||
|
||
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | ||
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
key: ${{ matrix.target }} | ||
save-if: ${{ github.ref == 'refs/heads/master' }} | ||
|
@@ -149,7 +183,7 @@ jobs: | |
|
||
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0 | ||
|
||
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | ||
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
save-if: ${{ github.ref == 'refs/heads/master' }} | ||
|
||
|
@@ -170,7 +204,7 @@ jobs: | |
|
||
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0 | ||
|
||
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | ||
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
key: ${{ matrix.features }} | ||
save-if: ${{ github.ref == 'refs/heads/master' }} | ||
|
@@ -187,7 +221,7 @@ jobs: | |
|
||
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0 | ||
|
||
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | ||
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
save-if: ${{ github.ref == 'refs/heads/master' }} | ||
|
||
|
@@ -200,9 +234,8 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
rust-version: [ | ||
# 1.72.0, # current stable | ||
# beta, | ||
nightly-2023-09-10 | ||
1.75.0, # current stable | ||
beta, | ||
] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -214,12 +247,11 @@ jobs: | |
|
||
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0 | ||
|
||
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | ||
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
save-if: ${{ github.ref == 'refs/heads/master' }} | ||
|
||
- name: Run cargo clippy | ||
run: cargo clippy | ||
- run: cargo clippy --all-targets --all-features | ||
|
||
ipfs-integration-test: | ||
name: IPFS Integration tests | ||
|
@@ -231,7 +263,7 @@ jobs: | |
|
||
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0 | ||
|
||
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | ||
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
save-if: ${{ github.ref == 'refs/heads/master' }} | ||
|
||
|
@@ -250,7 +282,7 @@ jobs: | |
|
||
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0 | ||
|
||
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | ||
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
shared-key: stable-cache | ||
save-if: false | ||
|
@@ -263,13 +295,31 @@ jobs: | |
cargo check --manifest-path "$toml"; | ||
done | ||
- uses: taiki-e/cache-cargo-install-action@v1 | ||
with: | ||
tool: [email protected] | ||
|
||
- name: Build webrtc-browser example | ||
run: | | ||
cd examples/browser-webrtc | ||
wasm-pack build --target web --out-dir static | ||
semver: | ||
runs-on: ubuntu-latest | ||
env: | ||
# Unset the global `RUSTFLAGS` env to allow warnings. | ||
# cargo-semver-checks intentionally re-locks dependency versions | ||
# before checking, and we shouldn't fail here if a dep has a warning. | ||
# | ||
# More context: | ||
# https://github.com/libp2p/rust-libp2p/pull/4932#issuecomment-1829014527 | ||
# https://github.com/obi1kenobi/cargo-semver-checks/issues/589 | ||
RUSTFLAGS: '' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: wget -q -O- https://github.com/obi1kenobi/cargo-semver-checks/releases/download/v0.24.0/cargo-semver-checks-x86_64-unknown-linux-gnu.tar.gz | tar -xz -C ~/.cargo/bin | ||
- run: wget -q -O- https://github.com/obi1kenobi/cargo-semver-checks/releases/download/v0.27.0/cargo-semver-checks-x86_64-unknown-linux-gnu.tar.gz | tar -xz -C ~/.cargo/bin | ||
shell: bash | ||
- uses: obi1kenobi/cargo-semver-checks-action@e275dda72e250d4df5b564e969e1348d67fefa52 # v2 | ||
- uses: obi1kenobi/cargo-semver-checks-action@48f4ef7da6d907d69d18249e0ba79aa98c61b9db # v2 | ||
|
||
rustfmt: | ||
runs-on: ubuntu-latest | ||
|
@@ -299,8 +349,6 @@ jobs: | |
ALL_FEATURES=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "libp2p") | .features | keys | map(select(. != "full")) | sort | join(" ")') | ||
FULL_FEATURE=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "libp2p") | .features["full"] | sort | join(" ")') | ||
test "$ALL_FEATURES = $FULL_FEATURE" | ||
echo "$ALL_FEATURES"; | ||
echo "$FULL_FEATURE"; | ||
|
@@ -326,12 +374,12 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | ||
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
|
||
- run: cargo install --version 0.10.0 pb-rs --locked | ||
|
||
- name: Glob match | ||
uses: tj-actions/glob@v17 | ||
uses: tj-actions/glob@v20 | ||
id: glob | ||
with: | ||
files: | | ||
|
@@ -352,7 +400,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | ||
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
- run: cargo metadata --locked --format-version=1 > /dev/null | ||
|
||
cargo-deny: | ||
|
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
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
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
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
Oops, something went wrong.