Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ozkanonur/rust-libp2p into gossip…
Browse files Browse the repository at this point in the history
…sub-wasm
  • Loading branch information
onur-ozkan committed Jul 19, 2023
2 parents 399b02c + 8c0c9cc commit b0b7f99
Show file tree
Hide file tree
Showing 109 changed files with 4,641 additions and 629 deletions.
30 changes: 21 additions & 9 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@ defaults:
method: squash
commit_message_template: |
{{ title }}
{{ body | get_section("## Description", "") }}
Pull-Request: #{{ number }}.
{# Here comes some fancy Jinja2 stuff for correctly attributing co-authorship: #}
{% for commit in (commits | unique(False, 'email_author')) | rejectattr("author", "==", author) %}
{% if commit.parents|length == 1 %}
Co-Authored-By: {{ commit.author }} <{{ commit.email_author }}>
{% endif %}
{% endfor %}
{# GitHub requires that the `Co-authored-by` lines are AT THE VERY END of a commit, hence nothing must come after this. #}
{{ body | get_section("## Attributions", "") }}
pull_request_rules:
- name: Ask to resolve conflict
Expand All @@ -38,6 +33,14 @@ pull_request_rules:
actions:
queue:

- name: Add approved dependabot PRs to merge queue
conditions:
# All branch protection rules are implicit: https://docs.mergify.com/conditions/#about-branch-protection
- author=dependabot[bot]
- base=master
actions:
queue:

- name: Remove reviews on updates after PR is queued for merging
conditions:
- base=master
Expand All @@ -57,6 +60,15 @@ pull_request_rules:
actions:
review:

- name: Approve dependabot PRs of semver-compatible updates
conditions:
- author=dependabot[bot]
- or:
- title~=bump [^\s]+ from ([1-9]+)\..+ to \1\. # For major >= 1 versions, only approve updates with the same major version.
- title~=bump [^\s]+ from 0\.([\d]+)\..+ to 0\.\1\. # For major == 0 versions, only approve updates with the same minor version.
actions:
review:

queue_rules:
- name: default
conditions: []
2 changes: 1 addition & 1 deletion .github/workflows/cache-factory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
with:
shared-key: stable-cache

Expand Down
53 changes: 42 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
with:
shared-key: stable-cache
save-if: false
Expand Down Expand Up @@ -76,12 +76,41 @@ jobs:
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 "Specified version: $SPECIFIED_VERSION";
test "$PACKAGE_VERSION" = "$SPECIFIED_VERSION"
wasm_tests:
name: Run all WASM tests
runs-on: ubuntu-latest
env:
CHROMEDRIVER_VERSION: '114.0.5735.90'
steps:
- uses: actions/checkout@v3

- uses: dtolnay/rust-toolchain@stable
with:
target: wasm32-unknown-unknown

- uses: taiki-e/cache-cargo-install-action@v1
with:
tool: wasm-pack@0.12.0

- name: Install Google Chrome
run: |
curl -o /tmp/google-chrome-stable_amd64.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROMEDRIVER_VERSION}-1_amd64.deb
sudo dpkg -i /tmp/google-chrome-stable_amd64.deb
- name: Install chromedriver
uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: ${{ env.CHROMEDRIVER_VERSION }}

- name: Run all tests
run: ./wasm-tests/run-all.sh

cross:
name: Compile on ${{ matrix.target }}
strategy:
Expand All @@ -107,7 +136,7 @@ jobs:

- uses: r7kamura/rust-problem-matchers@d58b70c4a13c4866d96436315da451d8106f8f08 #v1.3.0

- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
with:
key: ${{ matrix.target }}
save-if: ${{ github.ref == 'refs/heads/master' }}
Expand All @@ -132,7 +161,7 @@ jobs:

- uses: r7kamura/rust-problem-matchers@d58b70c4a13c4866d96436315da451d8106f8f08 #v1.3.0

- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
with:
save-if: ${{ github.ref == 'refs/heads/master' }}

Expand All @@ -153,7 +182,7 @@ jobs:

- uses: r7kamura/rust-problem-matchers@d58b70c4a13c4866d96436315da451d8106f8f08 #v1.3.0

- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
with:
key: ${{ matrix.features }}
save-if: ${{ github.ref == 'refs/heads/master' }}
Expand All @@ -170,7 +199,7 @@ jobs:

- uses: r7kamura/rust-problem-matchers@d58b70c4a13c4866d96436315da451d8106f8f08 #v1.3.0

- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
with:
save-if: ${{ github.ref == 'refs/heads/master' }}

Expand All @@ -196,7 +225,7 @@ jobs:

- uses: r7kamura/rust-problem-matchers@d58b70c4a13c4866d96436315da451d8106f8f08 #v1.3.0

- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
with:
save-if: ${{ github.ref == 'refs/heads/master' }}

Expand All @@ -213,7 +242,7 @@ jobs:

- uses: r7kamura/rust-problem-matchers@d58b70c4a13c4866d96436315da451d8106f8f08 #v1.3.0

- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
with:
save-if: ${{ github.ref == 'refs/heads/master' }}

Expand All @@ -229,7 +258,7 @@ jobs:

- uses: r7kamura/rust-problem-matchers@d58b70c4a13c4866d96436315da451d8106f8f08 #v1.3.0

- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
with:
shared-key: stable-cache
save-if: false
Expand Down Expand Up @@ -284,6 +313,8 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: dtolnay/rust-toolchain@stable

- id: cargo-metadata
run: |
WORKSPACE_MEMBERS=$(cargo metadata --format-version=1 --no-deps | jq -c '.packages | map(select(.publish == null) | .name)')
Expand All @@ -295,7 +326,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1

- run: cargo install --version 0.10.0 pb-rs --locked

Expand All @@ -321,5 +352,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
- run: cargo metadata --locked --format-version=1 > /dev/null
17 changes: 11 additions & 6 deletions .github/workflows/interop-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,21 @@ concurrency:
jobs:
run-multidim-interop:
name: Run multidimensional interoperability tests
runs-on: ${{ fromJSON(github.repository == 'libp2p/rust-libp2p' && '["self-hosted", "linux", "x64", "xlarge"]' || '"ubuntu-latest"') }}
runs-on: ${{ fromJSON(github.repository == 'libp2p/rust-libp2p' && '["self-hosted", "linux", "x64", "4xlarge"]' || '"ubuntu-latest"') }}
strategy:
matrix:
flavour: [chromium, native]
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- name: Build image
run: docker buildx build --load -t rust-libp2p-head . -f interop-tests/Dockerfile
- uses: libp2p/test-plans/.github/actions/run-interop-ping-test@master
- name: Build ${{ matrix.flavour }} image
run: docker buildx build --load -t ${{ matrix.flavour }}-rust-libp2p-head . -f interop-tests/Dockerfile.${{ matrix.flavour }}
- name: Run ${{ matrix.flavour }} tests
uses: libp2p/test-plans/.github/actions/run-interop-ping-test@master
with:
test-filter: rust-libp2p-head
extra-versions: ${{ github.workspace }}/interop-tests/ping-version.json
test-filter: ${{ matrix.flavour }}-rust-libp2p-head
extra-versions: ${{ github.workspace }}/interop-tests/${{ matrix.flavour }}-ping-version.json
s3-cache-bucket: libp2p-by-tf-aws-bootstrap
s3-access-key-id: ${{ vars.TEST_PLANS_BUILD_CACHE_KEY_ID }}
s3-secret-access-key: ${{ secrets.TEST_PLANS_BUILD_CACHE_KEY }}
worker-count: 16
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Contributing Guidelines

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
[![](https://img.shields.io/badge/project-libp2p-blue.svg?style=flat-square)](https://libp2p.io/)

Welcome to the rust-libp2p contribution guide! We appreciate your interest in improving our library.

## Looking for ways to contribute?

There are several ways you can contribute to rust-libp2p:
- Start contributing immediately via the opened [help wanted](https://github.com/libp2p/rust-libp2p/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) or [difficulty:easy](https://github.com/libp2p/rust-libp2p/issues?q=is%3Aissue+is%3Aopen+label%3Adifficulty%3Aeasy) issues on GitHub.
These issues are suitable for newcomers and provide an excellent starting point.
- Reporting issues, bugs, mistakes, or inconsistencies.
As many open source projects, we are short-staffed, we thus kindly ask you to be open to contribute a fix for discovered issues.

### We squash-merge pull Requests

We always squash merge submitted pull requests.
This means that we discourage force pushes, in order to make the diff between pushes easier for us to review.
Squash merging allows us to maintain a clean and organized commit history.

The PR title, which will become the commit message after the squashing process, should follow [conventional commit spec](https://www.conventionalcommits.org/en/v1.0.0/).

### Write changelog entries for user-facing changes

When making user-facing changes, it is important to include corresponding entries in the changelog, providing a comprehensive summary for the users.
For detailed instructions on how to write changelog entries, please refer to the documentation in [`docs/release.md`](https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md).


### Merging of PRs is automated

To streamline our workflow, we utilize Mergify and the "send-it" label.
Mergify automates merging actions and helps us manage pull requests more efficiently.
The "send-it" label indicates that a pull request is ready to be merged.
Please refrain from making further commits after the "send-it" label has been applied otherwise your PR will be dequeued from merging automatically.

### Treat CI as a self-service platform

We have a lot of automated CI checks for common errors.
Please treat our CI as a self-service platform and try to fix any issues before requesting a review.
Loading

0 comments on commit b0b7f99

Please sign in to comment.