refactor: migrate from Go to Rust implementation #16
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, master] | |
| pull_request: | |
| branches: [main, master] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build-and-test: | |
| name: Linux build and test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Install build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| cmake \ | |
| libssl-dev \ | |
| pkg-config \ | |
| libsasl2-dev \ | |
| protobuf-compiler | |
| # Verify cmake is available | |
| cmake --version | |
| which cmake | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "linux-build" | |
| - name: Set CMAKE environment variable | |
| run: | | |
| echo "CMAKE=$(which cmake)" >> $GITHUB_ENV | |
| echo "CMAKE set to: $(which cmake)" | |
| - name: Generate protocol files | |
| run: cargo check --package protocol | |
| - name: Format generated code | |
| run: cargo fmt --all | |
| - name: Check format | |
| run: cargo fmt --all -- --check | |
| - name: Build | |
| run: cargo build --all-targets --workspace | |
| - name: Test | |
| run: cargo test --workspace |