diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e6b4bdf --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,65 @@ +name: Test + +on: + push: + branches: + - main + pull_request: + branches: + - main + types: + - opened + - synchronize + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always + +jobs: + ci: + name: CI on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-24.04 + - macos-14 + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + rustflags: "" + + # ────────────── Install geth ────────────── + - name: Install Geth on Ubuntu + if: matrix.os == 'ubuntu-24.04' + run: | + sudo add-apt-repository -y ppa:ethereum/ethereum + sudo apt-get update + sudo apt-get install -y ethereum + + - name: Install Geth on macOS + if: matrix.os == 'macos-14' + run: | + brew tap ethereum/ethereum + brew install ethereum + + - name: Machete + uses: bnjbvr/cargo-machete@v0.7.1 + + - name: Format + run: make format + + - name: Clippy + run: make clippy + + - name: Test cargo workspace + run: make test diff --git a/Cargo.lock b/Cargo.lock index 0014281..8b71cb9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3032,11 +3032,7 @@ dependencies = [ "revive-dt-format", "revive-dt-node", "revive-dt-node-interaction", - "revive-dt-solc-binaries", "revive-solc-json-interface", - "semver 1.0.26", - "serde", - "serde_json", "temp-dir", ] @@ -3061,7 +3057,6 @@ dependencies = [ "log", "revive-dt-config", "revive-dt-node-interaction", - "serde_json", "temp-dir", ] @@ -3071,10 +3066,8 @@ version = "0.1.0" dependencies = [ "alloy", "anyhow", - "hex", "log", "once_cell", - "serde_json", "tokio", ] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4f68567 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +.PHONY: format clippy test machete + +format: + cargo fmt --all -- --check + +clippy: + cargo clippy --all-features --workspace -- --deny warnings + +test: + cargo test --workspace -- --nocapture + +machete: + cargo install cargo-machete + cargo machete diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index f5785c7..0fdce9c 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -18,7 +18,6 @@ revive-dt-config = { workspace = true } revive-dt-format = { workspace = true } revive-dt-node = { workspace = true } revive-dt-node-interaction = { workspace = true } -revive-dt-solc-binaries = { workspace = true } alloy = { workspace = true } anyhow = { workspace = true } @@ -27,7 +26,4 @@ log = { workspace = true } env_logger = { workspace = true } rayon = { workspace = true } revive-solc-json-interface = { workspace = true } -semver = { workspace = true } -serde = { workspace = true, features = [ "derive" ] } -serde_json = { workspace = true } temp-dir = { workspace = true } diff --git a/crates/node-interaction/Cargo.toml b/crates/node-interaction/Cargo.toml index 7029edc..117f904 100644 --- a/crates/node-interaction/Cargo.toml +++ b/crates/node-interaction/Cargo.toml @@ -11,8 +11,6 @@ rust-version.workspace = true [dependencies] alloy = { workspace = true } anyhow = { workspace = true } -hex = { workspace = true } log = { workspace = true } once_cell = { workspace = true } -serde_json = { workspace = true } tokio = { workspace = true } diff --git a/crates/node/Cargo.toml b/crates/node/Cargo.toml index 6ee9473..fa073ae 100644 --- a/crates/node/Cargo.toml +++ b/crates/node/Cargo.toml @@ -12,7 +12,6 @@ rust-version.workspace = true anyhow = { workspace = true } alloy = { workspace = true } log = { workspace = true } -serde_json = { workspace = true } revive-dt-node-interaction = { workspace = true } revive-dt-config = { workspace = true } diff --git a/crates/solc-binaries/src/cache.rs b/crates/solc-binaries/src/cache.rs index 75b83f3..d1a114a 100644 --- a/crates/solc-binaries/src/cache.rs +++ b/crates/solc-binaries/src/cache.rs @@ -60,7 +60,7 @@ fn download_to_file(path: &Path, downloader: &GHDownloader) -> anyhow::Result<() std::process::Command::new("xattr") .arg("-d") .arg("com.apple.quarantine") - .arg(&path) + .arg(path) .stderr(std::process::Stdio::null()) .stdout(std::process::Stdio::null()) .stdout(std::process::Stdio::null())