-
Notifications
You must be signed in to change notification settings - Fork 1
feat: ci #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
feat: ci #18
Changes from 33 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
0dd88c6
init bridge implementation
frisitano bce1586
extend bridge implementation
frisitano 972e9b0
merge main
frisitano 4b5fe5d
refactor and clean up dependencies
frisitano 47e691a
add .vscode to .gitignore
frisitano 72db12a
lint
frisitano 0c4d513
spacing
frisitano 4dbfd84
cleanup
frisitano cd4e9ed
wrap inner block import in bridge
frisitano 1c28847
add bridge integration test
frisitano 2ca0857
refactor and clean up
frisitano 0140a2d
add comments
frisitano fe772dc
migrate shared dependencies to workspace
frisitano f3e4b7a
feature propogation
frisitano 6bc2685
lints and feature fix
frisitano 7e24f45
remove scroll feature
frisitano 2f18f22
add scroll feature
frisitano b27e28d
integrate reth upstream changes
frisitano f6740f8
address PR feedback
frisitano 931f6b8
add systemd service file
frisitano 7e8f9d4
update systemd file
frisitano 5c1c639
update systemd file
frisitano f58ae56
feat: add ci
greged93 dfd5110
feat: lints and formatting
greged93 d16d017
feat: add lock file to version control
greged93 6889749
fix: ci
greged93 4b5742a
permission update
greged93 aea1776
feat: cargo docs alias
greged93 8843970
address comments
frisitano 7292a54
feat: reduce CI size for no_std checks
greged93 9674c23
Merge branch 'feat/gossip-source' into feat/ci
greged93 9b79771
fix: lints + imports
greged93 8267656
fix: use spaces iso tab
greged93 99b5f12
feat: Makefile
greged93 b672984
Merge branch 'main' into feat/ci
greged93 e6694a9
fix: small lints
greged93 8697e4f
fix: typo
greged93 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[alias] | ||
docs = "doc --workspace --all-features --no-deps" |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[codespell] | ||
skip = .git,target,Cargo.toml,Cargo.lock | ||
ignore-words-list = crate |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
version: | ||
format: 1 | ||
# Minimum zepter version that is expected to work. This is just for printing a nice error | ||
# message when someone tries to use an older version. | ||
binary: 0.13.2 | ||
|
||
# The examples in the following comments assume crate `A` to have a dependency on crate `B`. | ||
workflows: | ||
check: | ||
- [ | ||
"lint", | ||
# Check that `A` activates the features of `B`. | ||
"propagate-feature", | ||
# These are the features to check: | ||
"--features=std,dev,test-utils,serde-bincode-compat,serde,test-utils,arbitrary,bench", | ||
# Do not try to add a new section into `[features]` of `A` only because `B` expose that feature. There are edge-cases where this is still needed, but we can add them manually. | ||
"--left-side-feature-missing=ignore", | ||
# Ignore the case that `A` it outside of the workspace. Otherwise it will report errors in external dependencies that we have no influence on. | ||
"--left-side-outside-workspace=ignore", | ||
# Auxilary flags: | ||
"--offline", | ||
"--locked", | ||
"--show-path", | ||
"--quiet", | ||
] | ||
default: | ||
# Running `zepter` with no subcommand will check & fix. | ||
- [$check.0, "--fix"] | ||
|
||
# Will be displayed when any workflow fails: | ||
help: | ||
text: | | ||
We uses the Zepter CLI to detect abnormalities in Cargo features, e.g. missing propagation. | ||
|
||
It looks like one more checks failed; please check the console output. | ||
|
||
You can try to automatically address them by installing zepter (`cargo install zepter --locked`) and simply running `zepter` in the workspace root. | ||
links: | ||
- "https://github.com/ggwpez/zepter" |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/env bash | ||
set +e # Disable immediate exit on error | ||
|
||
crates=($(cargo metadata --format-version=1 --no-deps | jq -r '.packages[].name' | sort)) | ||
|
||
IFS=',' read -ra exclude_crates <<< "$EXCLUDE" | ||
unset IFS | ||
|
||
contains() { | ||
local ex="$1[@]" | ||
local input=$2 | ||
|
||
for ignore in "${!ex}"; | ||
do | ||
if [ "$ignore" = "$input" ]; | ||
then | ||
return 0 | ||
fi | ||
done | ||
return 1 | ||
} | ||
|
||
results=() | ||
any_failed=0 | ||
|
||
for crate in "${crates[@]}"; | ||
do | ||
if contains exclude_crates "$crate"; | ||
then | ||
results+=("⏭️ $crate") | ||
continue | ||
fi | ||
|
||
cmd="cargo +stable build -p $crate --target $TARGET --no-default-features" | ||
|
||
set +e # Disable immediate exit on error | ||
# Run the command and capture the return code | ||
# $cmd | ||
ret_code=$? | ||
set -e # Re-enable immediate exit on error | ||
|
||
if [ $ret_code -eq 0 ]; | ||
then | ||
results+=("✅ $crate") | ||
else | ||
results+=("❌ $crate") | ||
any_failed=1 | ||
fi | ||
done | ||
|
||
IFS=$'\n' sorted=$(sort <<< "${results[*]}") | ||
unset IFS | ||
|
||
printf "Build results: \n" | ||
for result in "${sorted[@]}"; | ||
do | ||
echo "${result}" | ||
done | ||
|
||
exit $any_failed |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,140 @@ | ||
name: lint | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
clippy: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: rui314/setup-mold@v1 | ||
- uses: dtolnay/rust-toolchain@clippy | ||
with: | ||
components: clippy | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- name: Run clippy | ||
run: cargo clippy --workspace --lib --examples --tests --benches --all-features --locked | ||
env: | ||
RUSTFLAGS: -D warnings | ||
|
||
fmt: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: rui314/setup-mold@v1 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: rustfmt | ||
- name: Run fmt | ||
run: cargo fmt --all --check | ||
|
||
udeps: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: rui314/setup-mold@v1 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- uses: taiki-e/install-action@cargo-udeps | ||
- name: Run udeps | ||
run: cargo udeps --workspace --lib --examples --tests --benches --all-features --locked | ||
|
||
zepter: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cargo-bins/cargo-binstall@main | ||
- name: fetch deps | ||
run: | | ||
# Eagerly pull dependencies | ||
cargo metadata --format-version=1 --locked > /dev/null | ||
- name: run zepter | ||
run: | | ||
cargo binstall zepter --force -y --locked | ||
zepter run check | ||
|
||
docs: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: rui314/setup-mold@v1 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- name: Run doc | ||
run: cargo docs --document-private-items | ||
env: | ||
RUSTDOCFLAGS: --cfg docsrs --show-type-layout --generate-link-to-definition --enable-index-page -Zunstable-options -D warnings | ||
|
||
codespell: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: codespell-project/actions-codespell@v2 | ||
with: | ||
skip: "*.json" | ||
|
||
features: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: rui314/setup-mold@v1 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: taiki-e/install-action@cargo-hack | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- name: Run feature check | ||
run: cargo hack check --feature-powerset --no-dev-deps | ||
|
||
no_std: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
strategy: | ||
matrix: | ||
include: | ||
- type: wasm | ||
target: wasm32-unknown-unknown | ||
exclude: engine,scroll-wire,scroll-bridge,scroll-network | ||
- type: riscv | ||
target: riscv32imac-unknown-none-elf | ||
exclude: engine,scroll-wire,scroll-bridge,scroll-network | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: rui314/setup-mold@v1 | ||
- uses: dcarbone/install-jq-action@v3 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: ${{ matrix.target }} | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- name: Run no_std check | ||
run: | | ||
sudo apt update && sudo apt install gcc-multilib | ||
.github/assets/check_no_std.sh | ||
env: | ||
TARGET: ${{ matrix.target }} | ||
EXCLUDE: ${{ matrix.exclude }} |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: test | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
unit: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
env: | ||
RUST_BACKTRACE: 1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: rui314/setup-mold@v1 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
toolchain: 'nightly' | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- uses: taiki-e/install-action@nextest | ||
- name: Run unit tests | ||
run: cargo nextest run --workspace --locked -E '!kind(test)' | ||
|
||
it: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe it would be preferable to be more verbose and name this |
||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
env: | ||
RUST_BACKTRACE: 1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: rui314/setup-mold@v1 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
toolchain: 'nightly' | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- uses: taiki-e/install-action@nextest | ||
- name: Run integration tests | ||
run: cargo nextest run --workspace --locked --no-tests=pass -E 'kind(test)' |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest recommendation for the Rust ecosystem is to add the
Cargo.lock
file to the version control, and either use dependabot orcargo update && cargo test
in CI.rust-lang/cargo#8728