Skip to content

clean up and add CI

clean up and add CI #2

Workflow file for this run

name: CI Checks
on:
push:
branches: [main, develop]
pull_request:
jobs:
cargo-test:
name: cargo test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: cargo test
run: cargo test --workspace --all-features
cargo-check:
name: cargo check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: cargo check
run: cargo check --workspace --all-features
cargo-fmt:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: cargo fmt
run: cargo fmt -- --check
cargo-fix:
name: cargo fix
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: cargo fix --workspace
run: |
# Run cargo fix on the project
cargo fix --workspace --all-features
# Check for local git changes
if ! git diff --exit-code; then
echo "There are local changes after running 'cargo fix --workspace' ❌"
exit 1
else
echo "No changes detected after running 'cargo fix --workspace' ✅"
fi
cargo-clippy:
name: cargo clippy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: cargo clippy
run: cargo clippy --workspace --all-features -- -D warnings
cargo-audit:
name: cargo audit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: install cargo-audit
run: cargo install cargo-audit
- name: cargo audit
run: cargo audit