From 86711cecdffd4bc6a681a01ebd41d3dcf197de37 Mon Sep 17 00:00:00 2001 From: Shuhui Luo <107524008+shuhuiluo@users.noreply.github.com> Date: Mon, 1 Apr 2024 04:04:00 -0500 Subject: [PATCH] chore: Update GitHub Actions and dependencies (#61) * Update GitHub Actions to latest versions The commit updates the used GitHub Actions to their latest versions. Specifically, it modifies the workflow files (publish.yml, rust.yml, lint.yml) to use actions/checkout@v4 and actions/cache@v4. Additionally, it simplifies the Rust toolchain setup in the lint workflow to just set the nightly toolchain override. * Update Rust toolchain setup in GitHub workflow The configuration for the Rust toolchain setup has been improved in the linting GitHub workflow. Not only does it set to use the nightly toolchain, but it also adds the clippy component for it. This ensures our workflow has the necessary tools for proper code linting. * Add rustfmt to lint workflow The commit includes rustfmt into the existing linting workflow in the Github actions. This additional component will help improve code formatting standards in the nightly toolchain. * Update package version and dependencies The package version of 'uniswap-sdk-core' has been upgraded from 0.20.1 to 0.21.0. Along with this, the dependency 'alloy-primitives' has also been updated from version 0.6 to 0.7. --- .github/workflows/lint.yml | 88 +++++++++++++++++------------------ .github/workflows/publish.yml | 2 +- .github/workflows/rust.yml | 4 +- Cargo.toml | 4 +- 4 files changed, 48 insertions(+), 50 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 98e5bb5..359ecbc 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,45 +1,43 @@ -name: Rust Linting - -on: - push: - branches: - - master - pull_request: - -env: - CARGO_TERM_COLOR: always - -jobs: - lint: - name: Rust Lint Check - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Cache Cargo registry - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-registry- - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - components: rustfmt, clippy - - - name: Check lint - run: cargo clippy -- -D warnings - - - name: Check formatting - run: cargo fmt -- --check +name: Rust Linting + +on: + push: + branches: + - master + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + lint: + name: Rust Lint Check + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Cache Cargo registry + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-registry- + + - name: Install Rust toolchain via rustup + run: | + rustup override set nightly + rustup component add clippy --toolchain nightly + rustup component add rustfmt --toolchain nightly + + - name: Check lint + run: cargo clippy -- -D warnings + + - name: Check formatting + run: cargo fmt -- --check diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a7857a8..f1c5172 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,7 +12,7 @@ jobs: name: Publish to crates.io runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5aaf3b8..c4a9dae 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -15,12 +15,12 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Cache Cargo registry - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cargo/registry diff --git a/Cargo.toml b/Cargo.toml index 8673438..a6547fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "uniswap-sdk-core" -version = "0.20.1" +version = "0.21.0" edition = "2021" authors = ["malik ", "Shuhui Luo "] description = "The Uniswap SDK Core in Rust provides essential functionality for interacting with the Uniswap decentralized exchange" license = "MIT" [dependencies] -alloy-primitives = "0.6" +alloy-primitives = "0.7" bigdecimal = "=0.4.2" eth_checksum = { version = "0.1.2", optional = true } lazy_static = "1.4"