diff --git a/.github/workflows/rust-checks.yml b/.github/workflows/rust-checks.yml index 17e1aa29..ab962e27 100644 --- a/.github/workflows/rust-checks.yml +++ b/.github/workflows/rust-checks.yml @@ -9,38 +9,73 @@ env: CARGO_TERM_COLOR: always jobs: - lint-and-test: - name: Lint and Test + fmt: + name: Formatting runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@nightly with: - components: clippy, rustfmt - - - name: Cache dependencies - uses: Swatinem/rust-cache@v2 - - - name: Check Cargo.lock is up-to-date - run: cargo check --locked --workspace + components: rustfmt - name: Check formatting run: cargo fmt --check --all + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@nightly + with: + components: clippy + + - name: Cache dependencies + uses: Swatinem/rust-cache@v2 + - name: Check clippy - run: cargo clippy --workspace --all-targets --all-features -- -D warnings + run: cargo clippy --locked --workspace --all-targets --all-features -- -D warnings + + doc: + name: Documentation + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@nightly + + - name: Cache dependencies + uses: Swatinem/rust-cache@v2 - name: Check documentation run: cargo doc --workspace --no-deps env: RUSTDOCFLAGS: "-D warnings" + test: + name: Tests + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@nightly + + - name: Cache dependencies + uses: Swatinem/rust-cache@v2 + - name: Run all tests env: RPC_URL: ${{ secrets.RPC_URL }} RPC_HEADERS: ${{ secrets.RPC_HEADERS }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: cargo test --release --workspace --all-features -- --no-capture \ No newline at end of file + run: cargo test --release --workspace --all-features -- --no-capture