Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 28 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,44 @@ on:
branches:
- main

env:
RUSTFLAGS: '-Dwarnings'

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

env:
RUSTFLAGS: '-Dwarnings'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Rust toolchain
run: rustup toolchain install stable --no-self-update --profile default --target wasm32-unknown-unknown

- name: Set up Rust cache
uses: swatinem/rust-cache@v2
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-on-failure: true
save-if: ${{ github.ref == 'refs/heads/main' }}
components: clippy, rustfmt
target: wasm32-unknown-unknown

- name: Check formatting
run: cargo fmt --all --check
- name: Install Cargo Binary Install
uses: cargo-bins/cargo-binstall@main

- name: Install crates
run: cargo binstall -y cargo-deny cargo-machete cargo-sort

- name: Lint
run: cargo clippy --all-features
run: cargo clippy --all-features --locked

- name: Check dependencies
run: cargo deny check

- name: Check unused dependencies
run: cargo machete

- name: Check manifest formatting
run: cargo sort --check

- name: Check formatting
run: cargo fmt --all --check

test:
name: Test
Expand Down Expand Up @@ -62,13 +74,10 @@ jobs:
uses: actions/checkout@v4

- name: Set up Rust toolchain
run: rustup toolchain install stable --no-self-update --profile default --target wasm32-unknown-unknown

- name: Set up Rust cache
uses: swatinem/rust-cache@v2
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-on-failure: true
save-if: ${{ github.ref == 'refs/heads/main' }}
components: clippy, rustfmt
target: wasm32-unknown-unknown

- name: Install Cargo Binary Install
uses: cargo-bins/cargo-binstall@main
Expand All @@ -77,4 +86,4 @@ jobs:
run: cargo binstall -y sea-orm-cli

- name: Test
run: cargo test --all-features
run: cargo test --all-features --locked
9 changes: 3 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@ jobs:
uses: actions/checkout@v4

- name: Set up Rust toolchain
run: rustup toolchain install stable --no-self-update --profile default --target wasm32-unknown-unknown

- name: Set up Rust cache
uses: swatinem/rust-cache@v2
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-on-failure: true
save-if: ${{ github.ref == 'refs/heads/main' }}
components: clippy, rustfmt
target: wasm32-unknown-unknown

- name: Install Cargo Binary Install
uses: cargo-bins/cargo-binstall@main
Expand Down
20 changes: 4 additions & 16 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,9 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Rust toolchain
run: |
rustup toolchain install stable --no-self-update --profile minimal
rustup target add wasm32-unknown-unknown

- name: Set up Rust cache
uses: swatinem/rust-cache@v2
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-on-failure: true
save-if: ${{ github.ref == 'refs/heads/main' }}
target: wasm32-unknown-unknown

- name: Install Cargo Binary Install
uses: cargo-bins/cargo-binstall@main
Expand All @@ -47,15 +41,9 @@ jobs:
fetch-depth: 0

- name: Set up Rust toolchain
run: |
rustup toolchain install stable --no-self-update --profile minimal
rustup target add wasm32-unknown-unknown

- name: Set up Rust cache
uses: swatinem/rust-cache@v2
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-on-failure: true
save-if: ${{ github.ref == 'refs/heads/main' }}
target: wasm32-unknown-unknown

- name: Install Cargo Binary Install
uses: cargo-bins/cargo-binstall@main
Expand Down
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,33 @@ repos:
- id: prettier
additional_dependencies:
- prettier@^3.4.2

- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
- id: clippy

- repo: https://github.com/EmbarkStudios/cargo-deny
rev: 0.18.3
hooks:
- id: cargo-deny

# - repo: https://github.com/bnjbvr/cargo-machete
# rev: ba1bcd4
# hooks:
# - id: cargo-machete
- repo: local
hooks:
- id: cargo-machete
name: cargo-machete
language: rust
entry: cargo machete
types: [file, toml]
files: Cargo\.(toml|lock)
pass_filenames: false

- repo: https://github.com/DevinR528/cargo-sort
rev: v2.0.1
hooks:
- id: cargo-sort
Loading
Loading