Skip to content

Commit

Permalink
Refactor CI workflows into a consolidated Rust CI pipeline.
Browse files Browse the repository at this point in the history
Merged linting and testing workflows into a unified `rust.yml` file for better organization and efficiency. Updated README with a single badge reflecting the new "Rust CI" workflow. Introduced enhanced test configurations, including feature-specific and doctest runs.
  • Loading branch information
shuhuiluo committed Jan 11, 2025
1 parent 3e138da commit fcd99c4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 49 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/lint.yml

This file was deleted.

46 changes: 36 additions & 10 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rust Tests
name: Rust CI

on:
push:
Expand All @@ -10,31 +10,57 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Rust Tests
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') }}
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Install Rust toolchain via rustup
run: |
rustup component add clippy
rustup component add rustfmt
- name: Check linting
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Check formatting
run: cargo fmt --all -- --check

test:
needs: lint
name: Rust Tests
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.toml') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Build
run: cargo build

- name: Run tests
- name: Run tests for default feature
run: cargo test

- name: Run tests with all features
run: cargo test --all-features
- name: Run tests for std feature
run: cargo test --features std
- name: Run doc tests
run: cargo test --doc --all-features
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Uniswap SDK Core Rust

[![Unit Tests](https://github.com/malik672/uniswap-sdk-core-rust/workflows/Rust%20Tests/badge.svg)](https://github.com/malik672/uniswap-sdk-core-rust/actions?query=workflow%3A%22Rust+Tests%22)
[![Lint](https://github.com/malik672/uniswap-sdk-core-rust/workflows/Rust%20Linting/badge.svg)](https://github.com/malik672/uniswap-sdk-core-rust/actions?query=workflow%3A%22Rust%20Linting%22)
[![Rust CI](https://github.com/malik672/uniswap-sdk-core-rust/actions/workflows/rust.yml/badge.svg)](https://github.com/malik672/uniswap-sdk-core-rust/actions/workflows/rust.yml)
![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/malik672/uniswap-sdk-core-rust?logo=rust&label=CodeRabbit&color=orange)
[![docs.rs](https://img.shields.io/docsrs/uniswap-sdk-core)](https://docs.rs/uniswap-sdk-core/latest)
[![crates.io](https://img.shields.io/crates/v/uniswap-sdk-core.svg)](https://crates.io/crates/uniswap-sdk-core)
Expand Down

0 comments on commit fcd99c4

Please sign in to comment.