chore: add benchmark (#99) #291
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main, development ] | |
| pull_request: | |
| branches: [ main, development ] | |
| workflow_call: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| DATABASE_URL: sqlite:wallet.db | |
| jobs: | |
| check: | |
| name: Format, Lint, Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - name: ubuntu dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo bash scripts/install_ubuntu_dependencies.sh | |
| - name: Install cargo-machete | |
| run: cargo install cargo-machete | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Install sqlx-cli | |
| run: cargo install sqlx-cli --no-default-features --features sqlite | |
| - name: Create database and run migrations | |
| run: cd minotari && sqlx database create && sqlx migrate run | |
| - name: Run clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Build | |
| run: cargo build --release --all-targets --all-features | |
| - name: Run tests | |
| run: cargo test --release --all-targets --all-features --workspace --exclude integration-tests | |
| - name: Run integration tests | |
| run: cargo test --release --test cucumber -- -t "not @benchmark" | |
| - name: Check unused dependencies | |
| run: cargo machete |