update ci #18
Workflow file for this run
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, develop, "feat/*"] | |
| pull_request: | |
| branches: [main, master, develop] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| check: | |
| name: Formatting and Linting Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: "v0-rust" | |
| shared-key: "stable" | |
| - run: pip install maturin | |
| - run: pip install -e .[dev] | |
| - run: make fmt-check && make lint | |
| test: | |
| name: Rust Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: "v0-rust" | |
| shared-key: "stable" | |
| - run: make test | |
| build: | |
| name: Build Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: "v0-rust" | |
| shared-key: "stable" | |
| - run: make build | |
| ci-success: | |
| name: CI Success | |
| runs-on: ubuntu-latest | |
| needs: [check, test, build] | |
| if: always() | |
| steps: | |
| - run: | | |
| if [[ "${{ needs.check.result }}" != "success" ]] || \ | |
| [[ "${{ needs.test.result }}" != "success" ]] || \ | |
| [[ "${{ needs.build.result }}" != "success" ]]; then | |
| echo "One or more jobs failed" | |
| exit 1 | |
| fi | |
| echo "All CI checks passed!" |