-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from paritytech/lexnv/test-bind-addr
tests: Add sysctl ipv6 and extra CI steps
- Loading branch information
Showing
28 changed files
with
222 additions
and
158 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 |
---|---|---|
|
@@ -12,98 +12,118 @@ concurrency: | |
# ${{ vars.CI_UNIFIED_IMAGE }} is defined in the repository variables | ||
|
||
jobs: | ||
check: | ||
name: "check" | ||
fmt: | ||
name: Cargo fmt | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ vars.CI_IMAGE }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
# uncomment if needed | ||
# - name: fmt | ||
# run: | | ||
# cargo fmt --all --check | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@v2.5.0 | ||
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
cache-on-failure: true | ||
cache-all-crates: true | ||
|
||
- name: check | ||
run: cargo check | ||
- name: Cargo fmt | ||
run: cargo +nightly fmt --all -- --check | ||
|
||
test: | ||
name: "test" | ||
machete: | ||
name: Check unused dependencies | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ vars.CI_IMAGE }} | ||
# options: --privileged | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
cache-on-failure: true | ||
cache-all-crates: true | ||
|
||
- name: Install cargo-machete | ||
run: cargo install cargo-machete | ||
|
||
# - name: Install Rust stable toolchain | ||
# uses: actions-rs/[email protected] | ||
# with: | ||
# profile: minimal | ||
# toolchain: 1.75.0 | ||
# override: true | ||
- name: Check unused dependencies | ||
run: cargo machete | ||
|
||
check: | ||
name: Cargo check | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ vars.CI_IMAGE }} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@v2.5.0 | ||
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
cache-on-failure: true | ||
cache-all-crates: true | ||
|
||
- name: test | ||
run: | | ||
# sudo apt-get update && sudo apt-get install -y iproute2 protobuf-compiler | ||
echo "Installing iproute2..." | ||
apt-get update && apt-get install -y iproute2 iputils-ping | ||
# ip a | ||
# echo "Enabling loopback interface explicitly..." | ||
# ip link set lo up | ||
echo "Result" | ||
ip a | ||
ping -c 1 127.0.0.1 | ||
echo "Starting a simple HTTP server..." | ||
python3 -m http.server --bind 127.0.0.1 8080 & | ||
sleep 1 | ||
curl 127.0.0.1:8080 | ||
echo "Running tests..." | ||
cargo test | ||
- name: Cargo check | ||
run: cargo check | ||
|
||
doc: | ||
name: "doc" | ||
name: Check documentation | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ vars.CI_IMAGE }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@v2.5.0 | ||
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
cache-on-failure: true | ||
cache-all-crates: true | ||
- name: doc | ||
run: cargo doc | ||
- name: Check documentation | ||
run: RUSTDOCFLAGS="-D warnings -D rustdoc::broken_intra_doc_links" cargo doc --workspace --no-deps --document-private-items | ||
|
||
clippy: | ||
name: "clippy" | ||
name: Cargo clippy | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ vars.CI_IMAGE }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@v2.5.0 | ||
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
cache-on-failure: true | ||
cache-all-crates: true | ||
|
||
- name: clippy | ||
# TODO: Allow clippy to fail and do not cancel other tasks. | ||
# Clippy is fixed by: https://github.com/paritytech/litep2p/pull/57. | ||
- name: Run clippy | ||
continue-on-error: true | ||
run: cargo clippy | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
container: | ||
image: ${{ vars.CI_IMAGE }} | ||
options: --sysctl net.ipv6.conf.all.disable_ipv6=0 | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
cache-on-failure: true | ||
cache-all-crates: true | ||
|
||
- name: Run tests | ||
run: cargo test |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,9 +1,20 @@ | ||
# Basic | ||
edition = "2021" | ||
max_width = 100 | ||
|
||
# Imports | ||
imports_granularity = "Crate" | ||
reorder_imports = true | ||
|
||
# Consistency | ||
newline_style = "Unix" | ||
|
||
# Misc | ||
chain_width = 80 | ||
spaces_around_ranges = false | ||
match_arm_blocks = false | ||
trailing_comma = "Vertical" | ||
edition = "2021" | ||
|
||
# Format comments | ||
comment_width = 100 | ||
wrap_comments = true |
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
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
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.