Skip to content

Commit

Permalink
Merge remote-tracking branch 'cecilia/serde-no-std' into sync-taiko-v3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
CeciliaZ030 committed Jan 18, 2024
2 parents a983b13 + 9a03c7e commit 3ec69ee
Show file tree
Hide file tree
Showing 156 changed files with 13,927 additions and 8,873 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/cachegrind.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Valgrind Cachegrind

on:
pull_request:
branches: [main]

jobs:
valgrind:
runs-on: ubuntu-latest
permissions: write-all

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup | Rust
uses: ATiltedTree/setup-rust@v1
with:
rust-version: stable

- name: Install Valgrind
run: |
sudo apt-get update
sudo apt-get install -y valgrind
- name: Run Valgrind
run: |
cargo b -r -p revm-test --bin snailtracer
valgrind --tool=cachegrind target/release/snailtracer 2>&1 | tee cachegrind_results.txt
- name: Valgrind results
id: valgrind_results
run: |
contents=$(printf "%s" "$(head -c 64000 cachegrind_results.txt)")
# dump line by line into a file
printf "Valgrind Results:\n\n\`\`\`\n%s\n\`\`\`" "$contents" > results.md
- name: Comment on PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Try to edit the last comment
if gh pr comment ${{ github.event.pull_request.number }} --edit-last --body-file results.md; then
echo "Successfully edited last comment."
else
echo "Failed to edit last comment. Trying to add a new comment instead!"
# If editing last comment fails, try to add a new comment
if ! gh pr comment ${{ github.event.pull_request.number }} --body-file results.md; then
echo "Comment failed to be made, printing out results here:"
cat results.md
fi
fi
122 changes: 78 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,65 +10,99 @@ on:
pull_request:
branches: [main, "release/**"]

env:
CARGO_TERM_COLOR: always

jobs:
tests-stable:
name: Tests (Stable)
test:
name: test ${{ matrix.rust }} ${{ matrix.flags }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
rust: ["stable", "beta", "nightly"]
flags: ["--no-default-features", "", "--all-features"]
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
targets: riscv32imac-unknown-none-elf

toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: cargo test --workspace ${{ matrix.flags }}

- name: cargo test
run: cargo test --workspace

- name: cargo test all features
run: cargo test --workspace --all-features

- name: cargo check no_std
run: cargo check --target riscv32imac-unknown-none-elf --no-default-features

lint:
name: Lint
test-no-std:
name: test no_std
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
cache-on-failure: true

- name: cargo fmt
run: cargo +nightly fmt --all -- --check

- name: cargo clippy
run: cargo +nightly clippy --workspace --all-features -- -D warnings
targets: riscv32imac-unknown-none-elf
- run: cargo check --target riscv32imac-unknown-none-elf --no-default-features

- name: cargo check no-default-features
run: |
check-no-default-features:
name: check no-default-features
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- run: |
cd crates/revm
cargo check --no-default-features
- name: cargo check serde
run: |
check-serde:
name: check serde
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- run: |
cd crates/revm
cargo check --no-default-features --features serde
- name: cargo check std
run: |
check-std:
name: check std
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- run: |
cd crates/revm
cargo check --no-default-features --features std
clippy:
name: clippy
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@clippy
- run: cargo +nightly clippy --workspace --all-targets --all-features
env:
RUSTFLAGS: -Dwarnings

docs:
name: docs
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rust-docs
- run: cargo doc --workspace --all-features --no-deps --document-private-items
env:
RUSTDOCFLAGS: "--cfg docsrs -D warnings"

fmt:
name: fmt
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo +nightly fmt --all --check
8 changes: 5 additions & 3 deletions .github/workflows/ethereum-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
pull_request:
branches: [main, "release/**"]


jobs:
tests-stable:
name: Ethereum Tests (Stable)
Expand All @@ -19,6 +18,7 @@ jobs:
strategy:
matrix:
profile: [ethtests, release]
target: [i686-unknown-linux-gnu, x86_64-unknown-linux-gnu]
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand All @@ -37,11 +37,13 @@ jobs:
with:
cache-on-failure: true

- name: Install cross
run: cargo install cross

- name: Run Ethereum tests
run: |
cargo run --profile ${{ matrix.profile }} -p revme -- statetest \
cross run --target ${{matrix.target}} --profile ${{ matrix.profile }} -p revme -- statetest \
ethtests/GeneralStateTests/ \
ethtests/LegacyTests/Constantinople/GeneralStateTests/ \
ethtests/EIPTests/StateTests/stEIP1153-transientStorage/ \
ethtests/EIPTests/StateTests/stEIP4844-blobtransactions/ \
ethtests/EIPTests/StateTests/stEIP5656-MCOPY/
41 changes: 41 additions & 0 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Documentation: https://release-plz.ieni.dev/docs
name: Release-plz

permissions:
pull-requests: write
contents: write

on:
push:
branches:
- main

jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
# Commits the cargo lock (generally a good practice for upstream libraries)
- name: Commit Cargo.lock
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add Cargo.lock
git commit -m "Update Cargo.lock" || echo "No changes to commit"
# This will run the release-plz action
# The action dectect API breaking changes detection with cargo-semver-checks.
# Semver is auto incremneted based on this
# A PR with the semver bump is created with a new release tag and changelog
# if you configure the cargo registry token, the action will also publish the new version to crates.io
- name: Run release-plz
uses: MarcoIeni/release-plz-action@v0.5
env:
# The admin of the repository with need to configure the following secrets:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ target
.idea
pkg/


bins/revme/temp_folder
bins/revme/tests
ethereumjs-util.js
book

# Generated by the block traces example
traces
Loading

0 comments on commit 3ec69ee

Please sign in to comment.